Fix article folder not being created

This commit is contained in:
Tim Van Baak 2020-04-21 08:56:36 -07:00
parent 44bb51f0a1
commit d0f57c85ce
2 changed files with 12 additions and 8 deletions

View File

@ -50,14 +50,14 @@ def prepend(*path):
joined = os.path.join(CONFIG_DIR, joined) joined = os.path.join(CONFIG_DIR, joined)
return joined return joined
def open_sh(*path, mode): def open_sh(*path, **kwargs):
return amanuensis.config.loader.open_sh(prepend(*path), mode) return amanuensis.config.loader.open_sh(prepend(*path), **kwargs)
def open_ex(*path, mode): def open_ex(*path, **kwargs):
return amanuensis.config.loader.open_ex(prepend(*path), mode) return amanuensis.config.loader.open_ex(prepend(*path), **kwargs)
def json_ro(*path): def json_ro(*path, **kwargs):
return amanuensis.config.loader.json_ro(prepend(*path)) return amanuensis.config.loader.json_ro(prepend(*path), **kwargs)
def json_rw(*path): def json_rw(*path, **kwargs):
return amanuensis.config.loader.json_rw(prepend(*path)) return amanuensis.config.loader.json_rw(prepend(*path), **kwargs)

View File

@ -55,9 +55,13 @@ def create_lexicon(name, editor):
cfg['editor'] = editor.uid cfg['editor'] = editor.uid
cfg['time']['created'] = int(time.time()) cfg['time']['created'] = int(time.time())
with json_rw(lex_dir, 'info.json', new=True) as info:
pass
# Create subdirectories # Create subdirectories
os.mkdir(prepend(lex_dir, 'draft')) os.mkdir(prepend(lex_dir, 'draft'))
os.mkdir(prepend(lex_dir, 'src')) os.mkdir(prepend(lex_dir, 'src'))
os.mkdir(prepend(lex_dir, 'article'))
# Update the index with the new lexicon # Update the index with the new lexicon
with json_rw('lexicon', 'index.json') as index: with json_rw('lexicon', 'index.json') as index: