Speed up jrnl by 10%, improve slow imports (#959)

* Improve slow imports
* Fix codestyle
* fix twice version validation
* Fix a syntax mistake
This commit is contained in:
wotgl 2020-05-28 00:11:40 +03:00 committed by GitHub
parent ef5f0a8331
commit 63df95f2ea
5 changed files with 47 additions and 32 deletions

View file

@ -27,7 +27,6 @@ import sys
import jrnl
from . import install, plugins, util
from .EncryptedJournal import EncryptedJournal
from .Journal import PlainJournal, open_journal
from .util import ERROR_COLOR, RESET_COLOR, UserAbort
@ -245,6 +244,8 @@ def guess_mode(args, config):
def encrypt(journal, filename=None):
""" Encrypt into new file. If filename is not set, we encrypt the journal file itself. """
from .EncryptedJournal import EncryptedJournal
journal.config["encrypt"] = True
new_journal = EncryptedJournal.from_journal(journal)