From d0f57c85cef417691d842a559380caef9e359a1e Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Tue, 21 Apr 2020 08:56:36 -0700 Subject: [PATCH] Fix article folder not being created --- amanuensis/config/__init__.py | 16 ++++++++-------- amanuensis/lexicon/manage.py | 4 ++++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/amanuensis/config/__init__.py b/amanuensis/config/__init__.py index bc53b40..6664346 100644 --- a/amanuensis/config/__init__.py +++ b/amanuensis/config/__init__.py @@ -50,14 +50,14 @@ def prepend(*path): joined = os.path.join(CONFIG_DIR, joined) return joined -def open_sh(*path, mode): - return amanuensis.config.loader.open_sh(prepend(*path), mode) +def open_sh(*path, **kwargs): + return amanuensis.config.loader.open_sh(prepend(*path), **kwargs) -def open_ex(*path, mode): - return amanuensis.config.loader.open_ex(prepend(*path), mode) +def open_ex(*path, **kwargs): + return amanuensis.config.loader.open_ex(prepend(*path), **kwargs) -def json_ro(*path): - return amanuensis.config.loader.json_ro(prepend(*path)) +def json_ro(*path, **kwargs): + return amanuensis.config.loader.json_ro(prepend(*path), **kwargs) -def json_rw(*path): - return amanuensis.config.loader.json_rw(prepend(*path)) +def json_rw(*path, **kwargs): + return amanuensis.config.loader.json_rw(prepend(*path), **kwargs) diff --git a/amanuensis/lexicon/manage.py b/amanuensis/lexicon/manage.py index 7d5bc55..99097c5 100644 --- a/amanuensis/lexicon/manage.py +++ b/amanuensis/lexicon/manage.py @@ -55,9 +55,13 @@ def create_lexicon(name, editor): cfg['editor'] = editor.uid cfg['time']['created'] = int(time.time()) + with json_rw(lex_dir, 'info.json', new=True) as info: + pass + # Create subdirectories os.mkdir(prepend(lex_dir, 'draft')) os.mkdir(prepend(lex_dir, 'src')) + os.mkdir(prepend(lex_dir, 'article')) # Update the index with the new lexicon with json_rw('lexicon', 'index.json') as index: