Merge pull request #9 from Neavend/master

Fix default parameters parsing and typo in logs when no links found
This commit is contained in:
Nick Sweeting 2017-05-06 17:38:05 -07:00 committed by GitHub
commit 055eb6f446

View file

@ -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)
@ -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)