Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code cleanup, matplotlib support and py2/py3 compatibility #12

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
enable old gitopts='...' for compatibility
  • Loading branch information
Paul Kienzle committed Nov 8, 2017
commit be24d4eaa52d3194789812a21a45a5bdca69aec8
5 changes: 4 additions & 1 deletion git-punchcard
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ in getting a relative estimate of when they work.

options = Options()

options.gitopts = tuple(arg for arg in sys.argv[1:] if arg.startswith('-'))
options.gitopts = list(arg for arg in sys.argv[1:] if arg.startswith('-'))
args = dict(arg.split('=', 1) for arg in sys.argv[1:] if not arg.startswith('-'))

for name, value in args.items():
Expand Down Expand Up @@ -99,6 +99,9 @@ in getting a relative estimate of when they work.
options.timezone = None
elif name == 'plotter':
options.plotter = value
elif name == 'gitopts':
# support for old-style gitopts="..."
options.gitopts.append(value)
else:
raise ValueError("unknown argument %r"%name)

Expand Down
4 changes: 2 additions & 2 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ echo
## git options: test 2: --before option

echo
echo "GIT OPTIONS: Invoking with --before='january 2014'"
echo "GIT OPTIONS: Invoking with gitopts=\"--before='january 2014'\""
echo "All timestamps are converted to UTC+7.5 before plotting the punchcard"
./git-punchcard --before="january 2014" opaque=0 file=git-options-before.png
./git-punchcard gitopts="--before=\"january 2014\"" opaque=0 file=git-options-before.png
echo

## git options: test 3: --since and before option
Expand Down