Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart committed Jun 9, 2023
1 parent f0fa069 commit 78bb69f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
4 changes: 3 additions & 1 deletion ypy_websocket/awareness.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import json
import time
from typing import Any, Dict
Expand All @@ -11,7 +13,7 @@ def __init__(self, ydoc):
self.meta = {}
self.states = {}

def get_changes(self, message: bytes) -> Dict[str, Any]:
def get_changes(self, message: bytes) -> dict[str, Any]:
message = read_message(message)
decoder = Decoder(message)
timestamp = int(time.time() * 1000)
Expand Down
2 changes: 1 addition & 1 deletion ypy_websocket/websocket_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def delete_room(self, *, name: str | None = None, room: YRoom | None = None):
if name is None:
name = self.get_room_name(room)
room = self.rooms[name]
room.exit()
room.stop()
del self.rooms[name]

async def serve(self, websocket):
Expand Down
2 changes: 1 addition & 1 deletion ypy_websocket/yroom.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import logging
from contextlib import AsyncExitStack
from functools import partial
from typing import Callable, List, Optional
from typing import Callable

import y_py as Y
from anyio import Event, create_memory_object_stream, create_task_group
Expand Down
2 changes: 1 addition & 1 deletion ypy_websocket/ystore.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from abc import ABC, abstractmethod
from contextlib import AsyncExitStack
from pathlib import Path
from typing import AsyncIterator, Callable, Optional, Tuple
from typing import AsyncIterator, Callable

import aiosqlite
import anyio
Expand Down
5 changes: 3 additions & 2 deletions ypy_websocket/yutils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

from enum import IntEnum
from pathlib import Path
from typing import Optional

import anyio
import y_py as Y
Expand Down Expand Up @@ -70,7 +71,7 @@ def read_var_uint(self) -> int:
break
return uint

def read_message(self) -> Optional[bytes]:
def read_message(self) -> bytes | None:
if self.length == 0:
return None
length = self.read_var_uint()
Expand Down

0 comments on commit 78bb69f

Please sign in to comment.