Skip to content

Commit

Permalink
Make options title/repository optional, add option -m/--max, major co…
Browse files Browse the repository at this point in the history
…de cleanup, full PEP8 compliance

All changes:
- chart title and repository are now optional and must be set with two
  new options:
    -t, --title (default: hardcoded in script, depends on the chart)
    -r, --repo (default: '.', ie current directory)
- add option -m/--max: max different entries in chart: after this
  number, an entry is counted in "others" (only for charts "authors" and
  "files_type")
- if filename is "-", display SVG content on standard output
- import the new division operator and the print function
- replace %-formatting with .format()
- full PEP8 compliance
- major code cleanup: add comments, dynamically build the names for week
  days and months, use a dynamic name for functions building a chart.
  • Loading branch information
flashcode committed Nov 2, 2013
1 parent 9a367bb commit 8202406
Show file tree
Hide file tree
Showing 2 changed files with 206 additions and 170 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,26 @@ installed with this command:

Note: cairosvg is required to generate PNG files.

## Usage

See output of command:

$ python gitchart.py -h

## Examples

Generate pie chart with authors:

$ python gitchart.py authors "Git authors" /path/to/gitrepo/ authors.svg
$ python gitchart.py -t "Git authors on project X" -r /path/to/gitrepo/ authors authors.svg

Generate bar chart with commits by year:

$ python gitchart.py commits_year "Git commits by year" /path/to/gitrepo/ commits_year.svg
$ python gitchart.py -r /path/to/gitrepo/ commits_year commits_year.svg

Generate bar chart with commits by version (tag):

$ cd /path/to/gitrepo/
$ git tag | python /path/to/gitchart.py commits_version "Git commits by version" . /tmp/commits_version.svg
$ git tag | python /path/to/gitchart.py commits_version /tmp/commits_version.svg

## Demo

Expand Down
Loading

0 comments on commit 8202406

Please sign in to comment.