mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-07-07 00:36:13 +02:00
Move import to be standalone command to reduce clutter in cli.py
This commit is contained in:
parent
ce07fedc06
commit
a54ed90259
9 changed files with 113 additions and 84 deletions
|
@ -21,3 +21,14 @@ def postconfig_list(config, **kwargs):
|
|||
from .util import list_journals
|
||||
|
||||
print(list_journals(config))
|
||||
|
||||
|
||||
def postconfig_import(args, config, **kwargs):
|
||||
from .plugins import get_importer
|
||||
from .Journal import open_journal
|
||||
|
||||
# Requires opening the journal
|
||||
journal = open_journal(args.journal_name, config)
|
||||
|
||||
format = args.export if args.export else "jrnl"
|
||||
get_importer(format).import_(journal, args.input)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue