mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-13 09:58:31 +02:00
more cleanup
This commit is contained in:
parent
62b733729e
commit
3624bde2c0
1 changed files with 7 additions and 9 deletions
|
@ -12,16 +12,14 @@ class EncryptionMethods(str, Enum):
|
||||||
JRNLV2 = "Jrnlv2Encryption"
|
JRNLV2 = "Jrnlv2Encryption"
|
||||||
|
|
||||||
|
|
||||||
ENCRYPTION_METHODS = {
|
def determine_encryption_method(config: str | bool) -> BaseEncryption:
|
||||||
# config: classname (as string)
|
ENCRYPTION_METHODS = {
|
||||||
True: EncryptionMethods.JRNLV2, # the default
|
True: EncryptionMethods.JRNLV2, # the default
|
||||||
False: EncryptionMethods.NONE,
|
False: EncryptionMethods.NONE,
|
||||||
"jrnlv1": EncryptionMethods.JRNLV1,
|
"jrnlv1": EncryptionMethods.JRNLV1,
|
||||||
"jrnlv2": EncryptionMethods.JRNLV2,
|
"jrnlv2": EncryptionMethods.JRNLV2,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def determine_encryption_method(config: str | bool) -> BaseEncryption:
|
|
||||||
key = config
|
key = config
|
||||||
if isinstance(config, str):
|
if isinstance(config, str):
|
||||||
key = config.lower()
|
key = config.lower()
|
||||||
|
|
Loading…
Add table
Reference in a new issue