From a04675e33e96794a5210c4048914d23aa9f076d0 Mon Sep 17 00:00:00 2001 From: Manuel Ebert Date: Sun, 15 Jul 2012 20:44:12 +0200 Subject: [PATCH] Allows multiple journals to override default configuration --- jrnl/jrnl.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jrnl/jrnl.py b/jrnl/jrnl.py index 6bfb8718..1211b4e7 100755 --- a/jrnl/jrnl.py +++ b/jrnl/jrnl.py @@ -146,8 +146,11 @@ def cli(): journal_name = args.text[0] if (args.text and args.text[0] in config['journals']) else 'default' if journal_name is not 'default': args.text = args.text[1:] - config['journal'] = config['journals'].get(journal_name) - + journal_conf = config['journals'].get(journal_name) + if type(journal_conf) is dict: # We can override the default config on a by-journal basis + config.update(journal_conf) + else: # But also just give them a string to point to the journal file + config['journal'] = journal_conf touch_journal(config['journal']) mode_compose, mode_export = guess_mode(args, config)