Skip to content

Commit

Permalink
pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
hbcarlos committed Feb 27, 2023
1 parent 2399aa0 commit d83973b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion jupyter_collaboration/app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.

from typing import Any, Dict

from jupyter_server.extension.application import ExtensionApp
from traitlets import Float, Int, Type
from ypy_websocket.ystore import BaseYStore
Expand Down Expand Up @@ -55,7 +57,7 @@ def initialize_settings(self):
)

def initialize_handlers(self):
rooms = {}
rooms: Dict[str, Any] = {}
self.handlers.extend(
[
(r"/api/yjs/roomid/(.*)", YDocRoomIdHandler, {"rooms": rooms}),
Expand Down
6 changes: 3 additions & 3 deletions jupyter_collaboration/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ async def __anext__(self):
raise StopAsyncIteration()
return message

def initialize(self, rooms: dict):
def initialize(self, rooms: Dict[str, Any]) -> None:
self._rooms: Dict[str, Any] = rooms

# Config
Expand Down Expand Up @@ -302,7 +302,7 @@ async def recv(self):
def on_message(self, message):
assert self.websocket_server is not None
message_type = message[0]
if message_type == YMessageType.AWARENESS:
if self.room is not None and message_type == YMessageType.AWARENESS:
# awareness
skip = False
changes = self.room.awareness.get_changes(message[1:])
Expand Down Expand Up @@ -405,7 +405,7 @@ def check_origin(self, origin):
class YDocRoomIdHandler(APIHandler):
auth_resource = "contents"

def initialize(self, rooms: dict):
def initialize(self, rooms: Dict[str, Any]) -> None:
self._rooms: Dict[str, Any] = rooms

@web.authenticated
Expand Down

0 comments on commit d83973b

Please sign in to comment.