From 599358d30c2a7dd8a82dea5db52e3bd37a4fc597 Mon Sep 17 00:00:00 2001 From: William Povell Date: Tue, 21 May 2013 21:53:47 -0400 Subject: [PATCH] Changed README.md to described added functionality. Also edited gitfiti.py to accept template files with newlines between templates. --- README.md | 25 ++++++++++++++++++++++++- gitfiti.py | 3 ++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5bfc49411..e8e17db23 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,29 @@ Included "art" from left to right: kitty, oneup, oneup2, hackerschool, octocat, 3. Run the generated `gitfiti.sh` from your home directory (or any non-git tracked dir) and watch it go to work. 4. Wait... Seriously, you'll probably need to wait a day or two for the gitfiti to show in your commit graph. +### User Templates +The file format for personal templates is the following: + +1. Each template starts off with a ":" and then a name (eg. ":foo") +2. Each line after that is part of a json-recognizable array. +3. The array contain values 0-4, 0 being blank and 4 being dark green. +4. To add multiple templates, just add another name tag as described in 1. + +For example: + +:center-blank +[[1,1,1,1,1,1,1], +[1,1,1,1,1,1,1], +[1,1,1,1,1,1,1], +[1,1,1,0,1,1,1], +[1,1,1,1,1,1,1], +[1,1,1,1,1,1,1], +[1,1,1,1,1,1,1]] + +This would output a 7 x 7 light green square with a single blank center square. + +Once you have a file with templates, enter its name when prompted and the templates will be added to the list of options. + ###Removal: Fortunately if you regret your gitfiti in the morning, removing it is fairly easy: delete the repo you created for your gitfiti (and wait). @@ -27,7 +50,7 @@ Fortunately if you regret your gitfiti in the morning, removing it is fairly eas ####Todo: - ~~Remove 'requests' dependency~~ - Web interface -- Load "art" from a file +- ~~Load "art" from a file~~ - Load commit content from a file - ... - Profit? diff --git a/gitfiti.py b/gitfiti.py index 5a7bf50f6..8e5e69d65 100755 --- a/gitfiti.py +++ b/gitfiti.py @@ -98,9 +98,10 @@ def load_images(imgNames): name = name[1:] while True: - imgLine = img.readline().replace('\n', '') + imgLine = img.readline() if imgLine == '': break + imgLine.replace('\n', '') if(imgLine[0] == ':'): loadedImgs[name] = json.loads(imgList) name = imgLine[1:]