Skip to content

Commit

Permalink
tlfp-parse-many: fix argument parsing
Browse files Browse the repository at this point in the history
"tlfp-parse-many --my-arg" was putting the data in a "--my-arg" directory
  • Loading branch information
mdamien committed Sep 10, 2018
1 parent d6f29f7 commit 65b038f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions bin/tlfp-parse-many
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ from tlfp.tools.common import open_json
from tlfp import parse_one


verbose = "--quiet" not in sys.argv
args = [arg for arg in sys.argv[1:] if '--' not in arg]
API_DIRECTORY = args[0] if len(args) > 0 else 'data'

API_DIRECTORY = sys.argv[1]
verbose = "--quiet" not in sys.argv

already_done = {}
for jsondos in glob.glob(os.path.join(API_DIRECTORY, '*/viz/procedure.json')):
Expand Down
2 changes: 1 addition & 1 deletion tlfp/parse_one.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def process(API_DIRECTORY, url):
print(' [] format data for the frontend')
format_data_for_frontend.process(dos_with_texts, API_DIRECTORY, log=log)
return dos
except KeyboardInterrupt as e:
except KeyboardInterrupt as e: # bypass the error log dump when doing Ctrl-C
raise e
except Exception as e:
print(*traceback.format_tb(e.__traceback__), e, sep='', file=log)
Expand Down

0 comments on commit 65b038f

Please sign in to comment.