From 15da50a9cf7c5e444cee8e6d68cf2c0729e44012 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Sat, 8 Oct 2022 15:27:42 -0700 Subject: [PATCH] don't use class variables because that's not what we want --- jrnl/encryption/BaseEncryption.py | 10 +++------- jrnl/encryption/BasePasswordEncryption.py | 10 +++------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/jrnl/encryption/BaseEncryption.py b/jrnl/encryption/BaseEncryption.py index 882c6cad..8e7ed466 100644 --- a/jrnl/encryption/BaseEncryption.py +++ b/jrnl/encryption/BaseEncryption.py @@ -10,14 +10,10 @@ from jrnl.messages import MsgText class BaseEncryption(ABC): - _encoding: str - _journal_name: str - _config: dict - def __init__(self, journal_name: str, config: dict): - self._encoding = "utf-8" - self._journal_name = journal_name - self._config = config + self._encoding: str = "utf-8" + self._journal_name: str = journal_name + self._config: dict = config def encrypt(self, text: str) -> str: return self._encrypt(text) diff --git a/jrnl/encryption/BasePasswordEncryption.py b/jrnl/encryption/BasePasswordEncryption.py index af0ba88d..9485fb46 100644 --- a/jrnl/encryption/BasePasswordEncryption.py +++ b/jrnl/encryption/BasePasswordEncryption.py @@ -7,15 +7,11 @@ from jrnl.prompt import prompt_password class BasePasswordEncryption(BaseEncryption): - _attempts: int - _max_attempts: int - _password: str - def __init__(self, *args, **kwargs) -> None: super().__init__(*args, **kwargs) - self._attempts = 0 - self._max_attempts = 3 - self._password = "" + self._attempts: int = 0 + self._max_attempts: int = 3 + self._password: str = "" # Check keyring first for password. # That way we'll have it.