Major refactor of the code
A lot of function are now using classes instead of parameters or tuples isort was added to the dev requirements Comments were adjusted
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
import string
|
||||
|
||||
from .classes import DecryptedAccount
|
||||
|
||||
FORBIDDEN_CHARS = frozenset("`\n")
|
||||
PUNCTUATION = frozenset(string.punctuation).difference(FORBIDDEN_CHARS)
|
||||
|
||||
@ -24,13 +26,13 @@ def check_password(passwd: str) -> bool:
|
||||
return _base_check(passwd)
|
||||
|
||||
|
||||
def check_account(name: str, login: str, passwd: str) -> bool:
|
||||
def check_account(account: DecryptedAccount) -> bool:
|
||||
"""Runs checks for account name, login and password"""
|
||||
return all(
|
||||
(
|
||||
check_account_name(name),
|
||||
check_login(login),
|
||||
check_password(passwd),
|
||||
check_account_name(account.name),
|
||||
check_login(account.login),
|
||||
check_password(account.password),
|
||||
)
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user