Properly initialise journal files after creating them

This commit is contained in:
Manuel Ebert 2015-04-04 18:58:33 +11:00
parent 4955902702
commit 75ecc0dbbd
4 changed files with 36 additions and 16 deletions

View file

@ -50,3 +50,10 @@ class EncryptedJournal(Journal.Journal):
journal = Fernet(key).encrypt(text.encode('utf-8'))
with open(filename, 'w') as f:
f.write(journal)
@classmethod
def _create(cls, filename, password):
key = make_key(password)
dummy = Fernet(key).encrypt("")
with open(filename, 'w') as f:
f.write(dummy)