don't use class variables because that's not what we want

This commit is contained in:
Jonathan Wren 2022-10-08 15:27:42 -07:00
parent 0466cda64f
commit 15da50a9cf
2 changed files with 6 additions and 14 deletions

View file

@ -10,14 +10,10 @@ from jrnl.messages import MsgText
class BaseEncryption(ABC): class BaseEncryption(ABC):
_encoding: str
_journal_name: str
_config: dict
def __init__(self, journal_name: str, config: dict): def __init__(self, journal_name: str, config: dict):
self._encoding = "utf-8" self._encoding: str = "utf-8"
self._journal_name = journal_name self._journal_name: str = journal_name
self._config = config self._config: dict = config
def encrypt(self, text: str) -> str: def encrypt(self, text: str) -> str:
return self._encrypt(text) return self._encrypt(text)

View file

@ -7,15 +7,11 @@ from jrnl.prompt import prompt_password
class BasePasswordEncryption(BaseEncryption): class BasePasswordEncryption(BaseEncryption):
_attempts: int
_max_attempts: int
_password: str
def __init__(self, *args, **kwargs) -> None: def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
self._attempts = 0 self._attempts: int = 0
self._max_attempts = 3 self._max_attempts: int = 3
self._password = "" self._password: str = ""
# Check keyring first for password. # Check keyring first for password.
# That way we'll have it. # That way we'll have it.