From bb1f263d6c1e4beb3aa96d3aea0bc5b5207de9e5 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Sat, 24 Sep 2022 06:11:04 -0700 Subject: [PATCH] rename function, fix some linting issues --- jrnl/Journal.py | 7 +++---- jrnl/encryption/__init__.py | 4 ++-- jrnl/upgrade.py | 1 + 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/jrnl/Journal.py b/jrnl/Journal.py index bb2b3c94..626fdd7d 100644 --- a/jrnl/Journal.py +++ b/jrnl/Journal.py @@ -5,12 +5,11 @@ import datetime import logging import os import re -from types import ModuleType +from jrnl import EncryptedJournal from jrnl import Entry from jrnl import time -from jrnl.encryption import BaseEncryption -from jrnl.encryption import determine_encryption_type +from jrnl.encryption import determine_encryption_method from jrnl.messages import Message from jrnl.messages import MsgStyle from jrnl.messages import MsgText @@ -82,7 +81,7 @@ class Journal: self.sort() def _get_encryption_method(self): - self._encryption_method = determine_encryption_type(self.config["encrypt"])( + self._encryption_method = determine_encryption_method(self.config["encrypt"])( self.config ) diff --git a/jrnl/encryption/__init__.py b/jrnl/encryption/__init__.py index af530889..78f84913 100644 --- a/jrnl/encryption/__init__.py +++ b/jrnl/encryption/__init__.py @@ -3,9 +3,9 @@ from jrnl.encryption.NoEncryption import NoEncryption -def determine_encryption_type(config): +def determine_encryption_method(config): encryption_method = NoEncryption - if config is True: + if config is True or config == "jrnlv2": # Default encryption method from jrnl.encryption.Jrnlv2Encryption import Jrnlv2Encryption diff --git a/jrnl/upgrade.py b/jrnl/upgrade.py index 84e20957..97f742a4 100644 --- a/jrnl/upgrade.py +++ b/jrnl/upgrade.py @@ -4,6 +4,7 @@ import os from jrnl import Journal +from jrnl import PlainJournal from jrnl import __version__ from jrnl.config import is_config_json from jrnl.config import load_config