From f6149af5a9de7b6093677a568e420b887e471341 Mon Sep 17 00:00:00 2001 From: Nicolas Simon Date: Sat, 6 May 2017 14:22:48 +0200 Subject: [PATCH 1/2] Fix name typo in debug when no links found --- archive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archive.py b/archive.py index 0070323c..bd86476b 100755 --- a/archive.py +++ b/archive.py @@ -187,7 +187,7 @@ def create_archive(service_file, service, resume=None): if not links: if service == "pocket": - print('[X] No links found in {}, is it a getpocket.com/export export?'.format(serivce_file)) + print('[X] No links found in {}, is it a getpocket.com/export export?'.format(service_file)) elif service == "pinboard": print ('[X] No links found in {}, is it a pinboard.in/export/format:json/ export?'.format(service_file)) raise SystemExit(1) From ab3fc13decf36b62b9d44d1cbcb88647ba4ae5cc Mon Sep 17 00:00:00 2001 From: Nicolas Simon Date: Sat, 6 May 2017 14:23:49 +0200 Subject: [PATCH 2/2] Fix default parameters parsing --- archive.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/archive.py b/archive.py index bd86476b..2e4bbb2b 100755 --- a/archive.py +++ b/archive.py @@ -208,12 +208,9 @@ def create_archive(service_file, service, resume=None): if __name__ == '__main__': service_file = 'ril_export.html' - resume = None - try: - service_file = sys.argv[1] # path to export file - service = sys.argv[2] or "pocket" # select service for file format select - resume = sys.argv[3] # timestamp to resume dowloading from - except IndexError: - pass + argc = len(sys.argv) + service_file = sys.argv[1] if argc > 1 else "ril_export.html" # path to export file + service = sys.argv[2] if argc > 2 else "pocket" # select service for file format select + resume = sys.argv[3] if argc > 3 else None # timestamp to resume dowloading from create_archive(service_file, service, resume=resume)