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
9796f5b0b0
commit
9a39c8962d
2 changed files with 14 additions and 4 deletions
|
@ -25,9 +25,19 @@ except ImportError:
|
||||||
clint = None
|
clint = None
|
||||||
|
|
||||||
class Journal:
|
class Journal:
|
||||||
def __init__(self, config, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
config.update(kwargs)
|
self.config = {
|
||||||
self.config = 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
|
# Set up date parser
|
||||||
consts = pdc.Constants()
|
consts = pdc.Constants()
|
||||||
|
|
|
@ -164,7 +164,7 @@ def cli():
|
||||||
mode_compose, mode_export = guess_mode(args, config)
|
mode_compose, mode_export = guess_mode(args, config)
|
||||||
|
|
||||||
# open journal file
|
# open journal file
|
||||||
journal = Journal.Journal(config=config)
|
journal = Journal.Journal(**config)
|
||||||
|
|
||||||
if mode_compose and not args.text:
|
if mode_compose and not args.text:
|
||||||
if config['editor']:
|
if config['editor']:
|
||||||
|
|
Loading…
Add table
Reference in a new issue