mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
ruff format
This commit is contained in:
parent
29eb3c8b62
commit
a7ea096b28
@ -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,
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
)
|
||||
|
||||
|
||||
|
@ -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()
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user