mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-29 14:06:14 +02:00
Suppress "Entry added" message if using default journal (#1561)
* Suppress "Entry added to default journal" message if using default journal * Replace "Entry added" BDD test steps with "we should get no error" now that the message is suppressed * Add positive and negative tests for "Entry added" message behavior
This commit is contained in:
parent
bb6491bd06
commit
f65f07dbcb
7 changed files with 57 additions and 35 deletions
14
jrnl/jrnl.py
14
jrnl/jrnl.py
|
@ -7,6 +7,7 @@ import sys
|
|||
from jrnl import install
|
||||
from jrnl import plugins
|
||||
from jrnl import time
|
||||
from jrnl.config import DEFAULT_JOURNAL_KEY
|
||||
from jrnl.config import get_config_path
|
||||
from jrnl.config import get_journal_name
|
||||
from jrnl.config import scope_config
|
||||
|
@ -146,13 +147,14 @@ def write_mode(args, config, journal, **kwargs):
|
|||
'Write mode: appending raw text to journal "%s": %s', args.journal_name, raw
|
||||
)
|
||||
journal.new_entry(raw)
|
||||
print_msg(
|
||||
Message(
|
||||
MsgText.JournalEntryAdded,
|
||||
MsgStyle.NORMAL,
|
||||
{"journal_name": args.journal_name},
|
||||
if args.journal_name != DEFAULT_JOURNAL_KEY:
|
||||
print_msg(
|
||||
Message(
|
||||
MsgText.JournalEntryAdded,
|
||||
MsgStyle.NORMAL,
|
||||
{"journal_name": args.journal_name},
|
||||
)
|
||||
)
|
||||
)
|
||||
journal.write()
|
||||
logging.debug("Write mode: completed journal.write()")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue