Update jrnl/jrnl.py with suggestion

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
This commit is contained in:
Suhas 2021-03-03 07:59:59 -05:00 committed by GitHub
parent 0a6e5f94c0
commit b1adedb575
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -334,19 +334,3 @@ def _display_search_results(args, journal, **kwargs):
print(exporter.export(journal, args.filename))
else:
print(journal.pprint())
def _export_journal(args: Namespace, journal: Journal):
"""Export journal using supplied export format
Export formats "short" and "pretty" are shorthands for pre-configured
jrnl behavior, hence those export formats bypass the export plugins.
:param args: parsed arguments
:type args: Namespace
:param journal: journal under use
:type journal: Journal
"""
# There are no exporter 'plugins' for pretty and short. We shouldn't expect this to be called for those two export formats.
assert args.export and args.export not in ("pretty", "short")
exporter = plugins.get_exporter(args.export)
print(exporter.export(journal, args.filename))