mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 16:48:31 +02:00
Journal class brings it's own default config.
This commit is contained in:
parent
bb090924c3
commit
f88eb8eb41
2 changed files with 14 additions and 4 deletions
|
@ -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()
|
||||
|
|
|
@ -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']:
|
||||
|
|
Loading…
Add table
Reference in a new issue