diff --git a/jrnl/messages.py b/jrnl/messages.py index 7d815fe8..639b1199 100644 --- a/jrnl/messages.py +++ b/jrnl/messages.py @@ -150,6 +150,11 @@ class MsgText(Enum): Headings increased past H6 on export - {date} {title} """ + # --- Import --- # + ImportSummary = """ + {count} imported to {journal_name} journal + """ + class Message(NamedTuple): text: MsgText diff --git a/jrnl/plugins/jrnl_importer.py b/jrnl/plugins/jrnl_importer.py index 54dd2ab8..d820aa8e 100644 --- a/jrnl/plugins/jrnl_importer.py +++ b/jrnl/plugins/jrnl_importer.py @@ -8,6 +8,7 @@ from jrnl.exception import JrnlException from jrnl.messages import Message from jrnl.messages import MsgText from jrnl.messages import MsgType +from jrnl.output import print_msg class JRNLImporter: @@ -34,8 +35,11 @@ class JRNLImporter: journal.import_(other_journal_txt) new_cnt = len(journal.entries) - print( - "[{} imported to {} journal]".format(new_cnt - old_cnt, journal.name), - file=sys.stderr, - ) journal.write() + print_msg( + Message( + MsgText.ImportSummary, + MsgType.NORMAL, + {"count": new_cnt - old_cnt, "journal_name": journal.name}, + ) + )