Skip to content

Commit ef31982

Browse files
committed
fix typos and missing type annotations (thanks @JGuinegagne)
1 parent a3dac7a commit ef31982

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

jupyter_server_documents/rooms/yroom.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ async def emit_load_event():
184184
def _init_ydoc(self) -> pycrdt.Doc:
185185
"""
186186
Initializes a YDoc, automatically binding its `_on_ydoc_update()`
187-
observer to `self._ydoc_subscription`. The observer can removed via
187+
observer to `self._ydoc_subscription`. The observer can be removed via
188188
`ydoc.unobserve(self._ydoc_subscription)`.
189189
"""
190190
self._ydoc = pycrdt.Doc()
@@ -698,7 +698,7 @@ def handle_inband_deletion(self) -> None:
698698
self.stop(close_code=4002, immediately=True)
699699

700700

701-
def stop(self, close_code: int = 1001, immediately: bool = False):
701+
def stop(self, close_code: int = 1001, immediately: bool = False) -> None:
702702
"""
703703
Stops the YRoom. This method:
704704
@@ -757,7 +757,7 @@ def stop(self, close_code: int = 1001, immediately: bool = False):
757757
self._stopped = True
758758

759759

760-
def _reset_ydoc(self):
760+
def _reset_ydoc(self) -> None:
761761
"""
762762
Deletes and re-initializes the YDoc, awareness, and JupyterYDoc. This
763763
frees the memory occupied by their histories.
@@ -790,7 +790,7 @@ def updated(self) -> bool:
790790
return self._updated
791791

792792

793-
def restart(self, close_code: int = 1001, immediately: bool = False):
793+
def restart(self, close_code: int = 1001, immediately: bool = False) -> None:
794794
"""
795795
Restarts the YRoom. This method re-initializes & reloads the YDoc,
796796
Awareness, and the JupyterYDoc. After this method is called, this

jupyter_server_documents/session_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ async def create_session(
134134
return session_model
135135

136136

137-
async def update_session(self, session_id, **update) -> None:
137+
async def update_session(self, session_id: str, **update) -> None:
138138
"""
139139
Updates the session identified by `session_id` using the keyword
140140
arguments passed to this method. Each keyword argument should correspond

jupyter_server_documents/websockets/clients.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def close_all(self, close_code: int):
198198
for client in clients:
199199
client.websocket.close(code=close_code)
200200

201-
def stop(self, close_code: int = 1001):
201+
def stop(self, close_code: int = 1001) -> None:
202202
"""
203203
Closes all Websocket connections with the given close code, removes all
204204
clients from this group. Future calls to `add()` are ignored until the
@@ -214,14 +214,14 @@ def stop(self, close_code: int = 1001):
214214
self._stopped = True
215215

216216
@property
217-
def stopped(self):
217+
def stopped(self) -> bool:
218218
"""
219219
Returns whether the client group is stopped.
220220
"""
221221

222222
return self._stopped
223223

224-
def restart(self, close_code: int = 1001):
224+
def restart(self, close_code: int = 1001) -> None:
225225
"""
226226
Restarts the client group by setting `stopped` to `False`. Future calls
227227
to `add()` will *not* be ignored after this method is called.

0 commit comments

Comments
 (0)