Journal class brings it's own default config.

This commit is contained in:
Manuel Ebert 2012-07-15 20:30:23 +02:00
parent 9796f5b0b0
commit 9a39c8962d
2 changed files with 14 additions and 4 deletions

View file

@ -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()

View file

@ -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']: