mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 16:48:31 +02:00
small code cleanup
This commit is contained in:
parent
66e23d1444
commit
526867bcdd
2 changed files with 4 additions and 9 deletions
|
@ -140,11 +140,6 @@ Python 3.7 (or higher) soon.
|
||||||
manual_args = sys.argv[1:]
|
manual_args = sys.argv[1:]
|
||||||
|
|
||||||
args = parse_args_before_config(manual_args)
|
args = parse_args_before_config(manual_args)
|
||||||
|
|
||||||
# import pprint
|
|
||||||
# pp = pprint.PrettyPrinter(depth=4)
|
|
||||||
# pp.pprint(args)
|
|
||||||
|
|
||||||
configure_logger(args.debug)
|
configure_logger(args.debug)
|
||||||
|
|
||||||
# Run command if possible before config is available
|
# Run command if possible before config is available
|
||||||
|
|
|
@ -141,14 +141,14 @@ def scope_config(config, journal_name):
|
||||||
return config
|
return config
|
||||||
config = config.copy()
|
config = config.copy()
|
||||||
journal_conf = config["journals"].get(journal_name)
|
journal_conf = config["journals"].get(journal_name)
|
||||||
if (
|
if type(journal_conf) is dict:
|
||||||
type(journal_conf) is dict
|
# We can override the default config on a by-journal basis
|
||||||
): # We can override the default config on a by-journal basis
|
|
||||||
log.debug(
|
log.debug(
|
||||||
"Updating configuration with specific journal overrides %s", journal_conf
|
"Updating configuration with specific journal overrides %s", journal_conf
|
||||||
)
|
)
|
||||||
config.update(journal_conf)
|
config.update(journal_conf)
|
||||||
else: # 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
|
config["journal"] = journal_conf
|
||||||
config.pop("journals")
|
config.pop("journals")
|
||||||
return config
|
return config
|
||||||
|
|
Loading…
Add table
Reference in a new issue