Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 29, 2024
1 parent 4c0c359 commit d49c62a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
5 changes: 3 additions & 2 deletions pycrdt_websocket/asgi_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ class ASGIServer:
def __init__(
self,
websocket_server: WebsocketServer,
on_connect: Callable[[dict[str, Any], dict[str, Any]], Awaitable[bool] | bool]
| None = None,
on_connect: (
Callable[[dict[str, Any], dict[str, Any]], Awaitable[bool] | bool] | None
) = None,
on_disconnect: Callable[[dict[str, Any]], Awaitable[None] | None] | None = None,
):
"""Initialize the object.
Expand Down
11 changes: 4 additions & 7 deletions pycrdt_websocket/ystore.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,13 @@ class BaseYStore(ABC):
@abstractmethod
def __init__(
self, path: str, metadata_callback: Callable[[], Awaitable[bytes] | bytes] | None = None
):
...
): ...

@abstractmethod
async def write(self, data: bytes) -> None:
...
async def write(self, data: bytes) -> None: ...

@abstractmethod
async def read(self) -> AsyncIterator[tuple[bytes, bytes]]:
...
async def read(self) -> AsyncIterator[tuple[bytes, bytes]]: ...

@property
def started(self) -> Event:
Expand Down Expand Up @@ -424,7 +421,7 @@ async def write(self, data: bytes) -> None:
async with db.execute(
"SELECT yupdate FROM yupdates WHERE path = ?", (self.path,)
) as cursor:
async for update, in cursor:
async for (update,) in cursor:
ydoc.apply_update(update)
# delete history
await db.execute("DELETE FROM yupdates WHERE path = ?", (self.path,))
Expand Down

0 comments on commit d49c62a

Please sign in to comment.