mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 16:48:31 +02:00
Journal uses self.config everywhere
This commit is contained in:
parent
192d2a0794
commit
608809b61c
1 changed files with 3 additions and 3 deletions
6
jrnl.py
6
jrnl.py
|
@ -99,9 +99,9 @@ class Journal:
|
||||||
current_entry = None
|
current_entry = None
|
||||||
|
|
||||||
with open(filename) as f:
|
with open(filename) as f:
|
||||||
if config['encrypt']:
|
if self.config['encrypt']:
|
||||||
journal_encrypted = f.read()
|
journal_encrypted = f.read()
|
||||||
key = config['key'] or getpass.getpass()
|
key = self.config['key'] or getpass.getpass()
|
||||||
key = self._block_tail(key)
|
key = self._block_tail(key)
|
||||||
self.crypto = AES.new(key, AES.MODE_ECB)
|
self.crypto = AES.new(key, AES.MODE_ECB)
|
||||||
journal_plain = self.crypto.decrypt(journal_encrypted)
|
journal_plain = self.crypto.decrypt(journal_encrypted)
|
||||||
|
@ -122,7 +122,7 @@ class Journal:
|
||||||
for line in journal_plain.split(os.linesep):
|
for line in journal_plain.split(os.linesep):
|
||||||
if line:
|
if line:
|
||||||
try:
|
try:
|
||||||
new_date = datetime.fromtimestamp(time.mktime(time.strptime(line[:date_length], config['timeformat'])))
|
new_date = datetime.fromtimestamp(time.mktime(time.strptime(line[:date_length], self.config['timeformat'])))
|
||||||
# make a journal entry of the current stuff first
|
# make a journal entry of the current stuff first
|
||||||
if new_date and current_entry:
|
if new_date and current_entry:
|
||||||
entries.append(current_entry)
|
entries.append(current_entry)
|
||||||
|
|
Loading…
Add table
Reference in a new issue