From 9a39c8962d85ebbdc44d0aaf8eb409a5c5a6cb8a Mon Sep 17 00:00:00 2001 From: Manuel Ebert Date: Sun, 15 Jul 2012 20:30:23 +0200 Subject: [PATCH] Journal class brings it's own default config. --- jrnl/Journal.py | 16 +++++++++++++--- jrnl/jrnl.py | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/jrnl/Journal.py b/jrnl/Journal.py index d88cd3f9..7d50827c 100644 --- a/jrnl/Journal.py +++ b/jrnl/Journal.py @@ -25,9 +25,19 @@ except ImportError: clint = None class Journal: - def __init__(self, config, **kwargs): - config.update(kwargs) - self.config = config + def __init__(self, **kwargs): + self.config = { + 'journal': "journal.txt", + 'encrypt': False, + 'password': "", + 'default_hour': 9, + 'default_minute': 0, + 'timeformat': "%Y-%m-%d %H:%M", + 'tagsymbols': '@', + 'highlight': True, + 'linewrap': 80, + } + self.config.update(kwargs) # Set up date parser consts = pdc.Constants() diff --git a/jrnl/jrnl.py b/jrnl/jrnl.py index 8abf87f2..3b533a3e 100755 --- a/jrnl/jrnl.py +++ b/jrnl/jrnl.py @@ -164,7 +164,7 @@ def cli(): mode_compose, mode_export = guess_mode(args, config) # open journal file - journal = Journal.Journal(config=config) + journal = Journal.Journal(**config) if mode_compose and not args.text: if config['editor']: