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:
|
if all:
|
||||||
return ApiDependencies.invoker.services.boards.get_all(archived)
|
return ApiDependencies.invoker.services.boards.get_all(archived)
|
||||||
elif offset is not None and limit is not None:
|
elif offset is not None and limit is not None:
|
||||||
return ApiDependencies.invoker.services.boards.get_many(
|
return ApiDependencies.invoker.services.boards.get_many(offset, limit, archived)
|
||||||
offset,
|
|
||||||
limit,
|
|
||||||
archived
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=400,
|
status_code=400,
|
||||||
|
@ -39,19 +39,11 @@ class BoardRecordStorageBase(ABC):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def get_many(
|
def get_many(self, offset: int = 0, limit: int = 10, archived: bool = False) -> OffsetPaginatedResults[BoardRecord]:
|
||||||
self,
|
|
||||||
offset: int = 0,
|
|
||||||
limit: int = 10,
|
|
||||||
archived: bool = False
|
|
||||||
) -> OffsetPaginatedResults[BoardRecord]:
|
|
||||||
"""Gets many board records."""
|
"""Gets many board records."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def get_all(
|
def get_all(self, archived: bool = False) -> list[BoardRecord]:
|
||||||
self,
|
|
||||||
archived: bool = False
|
|
||||||
) -> list[BoardRecord]:
|
|
||||||
"""Gets all board records."""
|
"""Gets all board records."""
|
||||||
pass
|
pass
|
||||||
|
@ -46,7 +46,7 @@ def deserialize_board_record(board_dict: dict) -> BoardRecord:
|
|||||||
created_at=created_at,
|
created_at=created_at,
|
||||||
updated_at=updated_at,
|
updated_at=updated_at,
|
||||||
deleted_at=deleted_at,
|
deleted_at=deleted_at,
|
||||||
archived=archived
|
archived=archived,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -145,12 +145,7 @@ class SqliteBoardRecordStorage(BoardRecordStorageBase):
|
|||||||
self._lock.release()
|
self._lock.release()
|
||||||
return self.get(board_id)
|
return self.get(board_id)
|
||||||
|
|
||||||
def get_many(
|
def get_many(self, offset: int = 0, limit: int = 10, archived: bool = False) -> OffsetPaginatedResults[BoardRecord]:
|
||||||
self,
|
|
||||||
offset: int = 0,
|
|
||||||
limit: int = 10,
|
|
||||||
archived: bool = False
|
|
||||||
) -> OffsetPaginatedResults[BoardRecord]:
|
|
||||||
try:
|
try:
|
||||||
self._lock.acquire()
|
self._lock.acquire()
|
||||||
|
|
||||||
@ -203,10 +198,7 @@ class SqliteBoardRecordStorage(BoardRecordStorageBase):
|
|||||||
finally:
|
finally:
|
||||||
self._lock.release()
|
self._lock.release()
|
||||||
|
|
||||||
def get_all(
|
def get_all(self, archived: bool = False) -> list[BoardRecord]:
|
||||||
self,
|
|
||||||
archived: bool = False
|
|
||||||
) -> list[BoardRecord]:
|
|
||||||
try:
|
try:
|
||||||
self._lock.acquire()
|
self._lock.acquire()
|
||||||
|
|
||||||
|
@ -43,19 +43,11 @@ class BoardServiceABC(ABC):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def get_many(
|
def get_many(self, offset: int = 0, limit: int = 10, archived: bool = False) -> OffsetPaginatedResults[BoardDTO]:
|
||||||
self,
|
|
||||||
offset: int = 0,
|
|
||||||
limit: int = 10,
|
|
||||||
archived: bool = False
|
|
||||||
) -> OffsetPaginatedResults[BoardDTO]:
|
|
||||||
"""Gets many boards."""
|
"""Gets many boards."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def get_all(
|
def get_all(self, archived: bool = False) -> list[BoardDTO]:
|
||||||
self,
|
|
||||||
archived: bool = False
|
|
||||||
) -> list[BoardDTO]:
|
|
||||||
"""Gets all boards."""
|
"""Gets all boards."""
|
||||||
pass
|
pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user