mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-17 19:48:31 +02:00
replace print statement for adding an entry to a journal
This commit is contained in:
parent
e130f26cf1
commit
f1bd01594e
2 changed files with 3 additions and 1 deletions
|
@ -14,6 +14,7 @@ from .editor import get_text_from_editor
|
||||||
from .editor import get_text_from_stdin
|
from .editor import get_text_from_stdin
|
||||||
from . import time
|
from . import time
|
||||||
from .override import apply_overrides
|
from .override import apply_overrides
|
||||||
|
from jrnl.output import print_msg
|
||||||
|
|
||||||
from jrnl.exception import JrnlException
|
from jrnl.exception import JrnlException
|
||||||
from jrnl.messages import Message
|
from jrnl.messages import Message
|
||||||
|
@ -144,7 +145,7 @@ def write_mode(args, config, journal, **kwargs):
|
||||||
'Write mode: appending raw text to journal "%s": %s', args.journal_name, raw
|
'Write mode: appending raw text to journal "%s": %s', args.journal_name, raw
|
||||||
)
|
)
|
||||||
journal.new_entry(raw)
|
journal.new_entry(raw)
|
||||||
print(f"[Entry added to {args.journal_name} journal]", file=sys.stderr)
|
print_msg( Message(MsgText.JournalEntryAdded, MsgType.NORMAL, {"journal_name": args.journal_name}))
|
||||||
journal.write()
|
journal.write()
|
||||||
logging.debug("Write mode: completed journal.write()", args.journal_name, raw)
|
logging.debug("Write mode: completed journal.write()", args.journal_name, raw)
|
||||||
|
|
||||||
|
|
|
@ -71,6 +71,7 @@ class MsgText(Enum):
|
||||||
|
|
||||||
# --- Journal status ---#
|
# --- Journal status ---#
|
||||||
JournalNotSaved = "Entry NOT saved to journal"
|
JournalNotSaved = "Entry NOT saved to journal"
|
||||||
|
JournalEntryAdded = "Entry added to {journal_name} journal"
|
||||||
|
|
||||||
# --- Editor ---#
|
# --- Editor ---#
|
||||||
WritingEntryStart = """
|
WritingEntryStart = """
|
||||||
|
|
Loading…
Add table
Reference in a new issue