From 7a311f8d731f24339aa98f7d254dd1916c09b90c Mon Sep 17 00:00:00 2001 From: monsieurswag Date: Wed, 15 May 2024 18:36:34 +0200 Subject: [PATCH] Formatter --- backend/core/models.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/backend/core/models.py b/backend/core/models.py index ea87c84d0..d783710b1 100644 --- a/backend/core/models.py +++ b/backend/core/models.py @@ -125,7 +125,9 @@ def __init_class__(cls): ) @classmethod - def store_library_content(cls, library_content: bytes,builtin: bool=False) -> "StoredLibrary | None": + def store_library_content( + cls, library_content: bytes, builtin: bool = False + ) -> "StoredLibrary | None": hash_checksum = sha256(library_content) if hash_checksum in StoredLibrary.HASH_CHECKSUM_SET: return None # We do not store the library if its hash checksum is in the database. @@ -182,10 +184,12 @@ def store_library_content(cls, library_content: bytes,builtin: bool=False) -> "S ) @classmethod - def store_library_file(cls, fname: Path,builtin: bool=False) -> "StoredLibrary | None": + def store_library_file( + cls, fname: Path, builtin: bool = False + ) -> "StoredLibrary | None": with open(fname, "rb") as f: library_content = f.read() - return StoredLibrary.store_library_content(library_content,builtin) + return StoredLibrary.store_library_content(library_content, builtin) def load(self) -> Union[str, None]: from library.utils import LibraryImporter