From 3624bde2c0cf08673857012666329b35dc8bcddf Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Sat, 1 Oct 2022 10:17:55 -0700 Subject: [PATCH] more cleanup --- jrnl/encryption/__init__.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/jrnl/encryption/__init__.py b/jrnl/encryption/__init__.py index aed00297..286c8081 100644 --- a/jrnl/encryption/__init__.py +++ b/jrnl/encryption/__init__.py @@ -12,16 +12,14 @@ class EncryptionMethods(str, Enum): JRNLV2 = "Jrnlv2Encryption" -ENCRYPTION_METHODS = { - # config: classname (as string) - True: EncryptionMethods.JRNLV2, # the default - False: EncryptionMethods.NONE, - "jrnlv1": EncryptionMethods.JRNLV1, - "jrnlv2": EncryptionMethods.JRNLV2, -} - - def determine_encryption_method(config: str | bool) -> BaseEncryption: + ENCRYPTION_METHODS = { + True: EncryptionMethods.JRNLV2, # the default + False: EncryptionMethods.NONE, + "jrnlv1": EncryptionMethods.JRNLV1, + "jrnlv2": EncryptionMethods.JRNLV2, + } + key = config if isinstance(config, str): key = config.lower()