From e90a1b0d83a02968a382ac416ad54ce3bd0a44c5 Mon Sep 17 00:00:00 2001 From: rachmadaniHaryono Date: Mon, 8 May 2017 06:26:28 +0800 Subject: [PATCH 1/5] chg: dev: add program version --- export_saved.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/export_saved.py b/export_saved.py index 8cc10d5..7165f7c 100755 --- a/export_saved.py +++ b/export_saved.py @@ -15,6 +15,9 @@ import praw +__version__ = '0.1.1' + + # # Converter class from https://gist.github.com/raphaa/1327761 class Converter(): """Converts a CSV instapaper export to a Chrome bookmark file.""" @@ -95,6 +98,7 @@ def get_args(argv): action="store_true") parser.add_argument("-all", "--all", help="get upvoted, saved, comments and submissions", action="store_true") + parser.add_argument("-v", "--version", help="get program version.", action="store_true") args = parser.parse_args(argv) return args From 81ec502aa368bd821f3bb3286552030f4d89e30a Mon Sep 17 00:00:00 2001 From: rachmadaniHaryono Date: Mon, 8 May 2017 06:38:07 +0800 Subject: [PATCH 2/5] chg: usr: print program version --- export_saved.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/export_saved.py b/export_saved.py index 7165f7c..0ff848c 100755 --- a/export_saved.py +++ b/export_saved.py @@ -306,6 +306,10 @@ def main(): # set logging config if args.verbose: logging.basicConfig(level=logging.DEBUG) + # print program version. + if args.version: + print(__version__) + return reddit = login(args=args) if args.upvoted: From f2578e73a3f5ae09a62e73bf6ef11b31cb6bc5a4 Mon Sep 17 00:00:00 2001 From: rachmadaniHaryono Date: Mon, 8 May 2017 06:33:18 +0800 Subject: [PATCH 3/5] fix: dev: fix conflict flag --- export_saved.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/export_saved.py b/export_saved.py index 0ff848c..723fba6 100755 --- a/export_saved.py +++ b/export_saved.py @@ -98,7 +98,7 @@ def get_args(argv): action="store_true") parser.add_argument("-all", "--all", help="get upvoted, saved, comments and submissions", action="store_true") - parser.add_argument("-v", "--version", help="get program version.", action="store_true") + parser.add_argument("-V", "--version", help="get program version.", action="store_true") args = parser.parse_args(argv) return args From 03f890834c986bd795f72cf6daa7fb42ac258748 Mon Sep 17 00:00:00 2001 From: rachmadaniHaryono Date: Mon, 8 May 2017 06:46:30 +0800 Subject: [PATCH 4/5] chg: test: default args. --- tests/test_export_saved.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_export_saved.py b/tests/test_export_saved.py index 3711c82..a12dd59 100644 --- a/tests/test_export_saved.py +++ b/tests/test_export_saved.py @@ -14,7 +14,8 @@ { 'all': False, 'upvoted': False, 'verbose': False, 'client_secret': None, 'password': None, - 'username': None, 'client_id': None + 'username': None, 'client_id': None, + 'version': False } )] ) From 9d4d0272e0bcc818234526006e7d4dc3525831fa Mon Sep 17 00:00:00 2001 From: rachmadaniHaryono Date: Mon, 8 May 2017 06:48:08 +0800 Subject: [PATCH 5/5] fix: test: add version on args namespace --- tests/test_export_saved.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_export_saved.py b/tests/test_export_saved.py index a12dd59..72a5fda 100644 --- a/tests/test_export_saved.py +++ b/tests/test_export_saved.py @@ -174,6 +174,7 @@ def test_main(verbose, upvoted, all): verbose=verbose, upvoted=upvoted, all=all, + version=False ) import export_saved # run