diff --git a/README.md b/README.md index e03dc82..a5caa9a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Sand -## Exécution avec Python 3.10.8 +## Exécution avec Python 3.9.2 Préparation de l'environnement diff --git a/src/config.py b/src/config.py index 9b5da90..b6a0f0c 100644 --- a/src/config.py +++ b/src/config.py @@ -34,7 +34,7 @@ def init() -> None: # Create upload folder if doesn't exists if not exist(Config.uploads_dir): - mkdir(path=Config.uploads_dir) + mkdir(Config.uploads_dir) # TODO: Clear every t mins the uploads directory and database # TODO: On init, check if files in db are corresponding to the files stored diff --git a/src/utils/misc.py b/src/utils/misc.py index 3e24608..62764db 100644 --- a/src/utils/misc.py +++ b/src/utils/misc.py @@ -1,5 +1,4 @@ from hashlib import sha256 -from sys import set_int_max_str_digits BYTEORDER = "big" @@ -23,6 +22,4 @@ def int_to_bytes(data: int) -> bytes: def hash_data(string: str) -> str: """Hash a string""" - # https://docs.python.org/3/library/sys.html#sys.set_int_max_str_digits - set_int_max_str_digits(len(string)) return str(int.from_bytes(sha256(int_to_bytes(int(string))).digest(), BYTEORDER)) diff --git a/src/utils/sqlite.py b/src/utils/sqlite.py index c69bff0..c9810d7 100644 --- a/src/utils/sqlite.py +++ b/src/utils/sqlite.py @@ -1,5 +1,5 @@ from os import mkdir -from sqlite3 import Cursor, connect +from sqlite3 import connect from utils.misc import exist @@ -17,7 +17,7 @@ class Database: self.fullpath = fullpath - def request(self, request: str, valeurs=None) -> tuple[Cursor, int | None]: + def request(self, request: str, valeurs=None) -> tuple: """Send a request to the database""" connection = connect(self.fullpath) cursor = connection.cursor()