ruff format

This commit is contained in:
maryhipp 2024-06-26 14:40:21 -04:00 committed by psychedelicious
parent 29eb3c8b62
commit a7ea096b28
5 changed files with 8 additions and 36 deletions

View File

@ -124,11 +124,7 @@ async def list_boards(
if all:
return ApiDependencies.invoker.services.boards.get_all(archived)
elif offset is not None and limit is not None:
return ApiDependencies.invoker.services.boards.get_many(
offset,
limit,
archived
)
return ApiDependencies.invoker.services.boards.get_many(offset, limit, archived)
else:
raise HTTPException(
status_code=400,

View File

@ -39,19 +39,11 @@ class BoardRecordStorageBase(ABC):
pass
@abstractmethod
def get_many(
self,
offset: int = 0,
limit: int = 10,
archived: bool = False
) -> OffsetPaginatedResults[BoardRecord]:
def get_many(self, offset: int = 0, limit: int = 10, archived: bool = False) -> OffsetPaginatedResults[BoardRecord]:
"""Gets many board records."""
pass
@abstractmethod
def get_all(
self,
archived: bool = False
) -> list[BoardRecord]:
def get_all(self, archived: bool = False) -> list[BoardRecord]:
"""Gets all board records."""
pass

View File

@ -46,7 +46,7 @@ def deserialize_board_record(board_dict: dict) -> BoardRecord:
created_at=created_at,
updated_at=updated_at,
deleted_at=deleted_at,
archived=archived
archived=archived,
)

View File

@ -145,12 +145,7 @@ class SqliteBoardRecordStorage(BoardRecordStorageBase):
self._lock.release()
return self.get(board_id)
def get_many(
self,
offset: int = 0,
limit: int = 10,
archived: bool = False
) -> OffsetPaginatedResults[BoardRecord]:
def get_many(self, offset: int = 0, limit: int = 10, archived: bool = False) -> OffsetPaginatedResults[BoardRecord]:
try:
self._lock.acquire()
@ -203,10 +198,7 @@ class SqliteBoardRecordStorage(BoardRecordStorageBase):
finally:
self._lock.release()
def get_all(
self,
archived: bool = False
) -> list[BoardRecord]:
def get_all(self, archived: bool = False) -> list[BoardRecord]:
try:
self._lock.acquire()

View File

@ -43,19 +43,11 @@ class BoardServiceABC(ABC):
pass
@abstractmethod
def get_many(
self,
offset: int = 0,
limit: int = 10,
archived: bool = False
) -> OffsetPaginatedResults[BoardDTO]:
def get_many(self, offset: int = 0, limit: int = 10, archived: bool = False) -> OffsetPaginatedResults[BoardDTO]:
"""Gets many boards."""
pass
@abstractmethod
def get_all(
self,
archived: bool = False
) -> list[BoardDTO]:
def get_all(self, archived: bool = False) -> list[BoardDTO]:
"""Gets all boards."""
pass