mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-20 21:18:32 +02:00
Merge branch 'develop' into black
This commit is contained in:
commit
e984a9a015
2 changed files with 33 additions and 32 deletions
|
@ -61,11 +61,12 @@ def open_journal(journal_name="default"):
|
|||
config = util.load_config(install.CONFIG_FILE_PATH)
|
||||
journal_conf = config["journals"][journal_name]
|
||||
|
||||
# We can override the default config on a by-journal basis
|
||||
|
||||
if type(journal_conf) is dict:
|
||||
# We can override the default config on a by-journal basis
|
||||
config.update(journal_conf)
|
||||
# But also just give them a string to point to the journal file
|
||||
else:
|
||||
# But also just give them a string to point to the journal file
|
||||
config["journal"] = journal_conf
|
||||
|
||||
return Journal.open_journal(journal_name, config)
|
||||
|
@ -129,11 +130,13 @@ def run_with_input(context, command, inputs=""):
|
|||
text = iter([inputs])
|
||||
|
||||
args = ushlex(command)[1:]
|
||||
|
||||
# fmt: off
|
||||
# black needs the 'on' and 'off' to be at the same indentation level
|
||||
with patch("builtins.input", side_effect=_mock_input(text)) as mock_input,\
|
||||
patch("getpass.getpass", side_effect=_mock_getpass(text)) as mock_getpass,\
|
||||
# see: https://github.com/psf/black/issues/557
|
||||
with patch("builtins.input", side_effect=_mock_input(text)) as mock_input, \
|
||||
patch("getpass.getpass", side_effect=_mock_getpass(text)) as mock_getpass, \
|
||||
patch("sys.stdin.read", side_effect=text) as mock_read:
|
||||
|
||||
try:
|
||||
cli.run(args or [])
|
||||
context.exit_status = 0
|
||||
|
|
|
@ -231,8 +231,7 @@ class Journal:
|
|||
result = [
|
||||
entry
|
||||
for entry in self.entries
|
||||
if (
|
||||
(not tags or tagged(entry.tags))
|
||||
if (not tags or tagged(entry.tags))
|
||||
and (not starred or entry.starred)
|
||||
and (not start_date or entry.date >= start_date)
|
||||
and (not end_date or entry.date <= end_date)
|
||||
|
@ -244,7 +243,6 @@ class Journal:
|
|||
or contains_lower in entry.body.casefold()
|
||||
)
|
||||
)
|
||||
)
|
||||
]
|
||||
|
||||
self.entries = result
|
||||
|
|
Loading…
Add table
Reference in a new issue