@@ -224,9 +224,7 @@ async def open(self, room_id):
224224 self .log .error (f"File { file .path } not found.\n { e !r} " , exc_info = e )
225225 self .close (1004 , f"File { file .path } not found." )
226226 else :
227- self .log .error (
228- f"Error initializing: { file .path } \n { e !r} " , exc_info = e
229- )
227+ self .log .error (f"Error initializing: { file .path } \n { e !r} " , exc_info = e )
230228 self .close (
231229 1003 ,
232230 f"Error initializing: { file .path } . You need to close the document." ,
@@ -306,14 +304,10 @@ async def on_message(self, message):
306304 for client in self .room .clients :
307305 if client != self :
308306 task = asyncio .create_task (
309- client .send (
310- bytes ([MessageType .CHAT ]) + write_var_uint (len (data )) + data
311- )
307+ client .send (bytes ([MessageType .CHAT ]) + write_var_uint (len (data )) + data )
312308 )
313309 self ._websocket_server .background_tasks .add (task )
314- task .add_done_callback (
315- self ._websocket_server .background_tasks .discard
316- )
310+ task .add_done_callback (self ._websocket_server .background_tasks .discard )
317311
318312 self ._message_queue .put_nowait (message )
319313 self ._websocket_server .ypatch_nb += 1
@@ -332,9 +326,7 @@ def on_close(self) -> None:
332326 if self ._room_id != "JupyterLab:globalAwareness" :
333327 self ._emit_awareness_event (self .current_user .username , "leave" )
334328
335- def _emit (
336- self , level : LogLevel , action : str | None = None , msg : str | None = None
337- ) -> None :
329+ def _emit (self , level : LogLevel , action : str | None = None , msg : str | None = None ) -> None :
338330 _ , _ , file_id = decode_file_path (self ._room_id )
339331 path = self ._file_id_manager .get_path (file_id )
340332
@@ -346,16 +338,12 @@ def _emit(
346338
347339 self .event_logger .emit (schema_id = JUPYTER_COLLABORATION_EVENTS_URI , data = data )
348340
349- def _emit_awareness_event (
350- self , username : str , action : str , msg : str | None = None
351- ) -> None :
341+ def _emit_awareness_event (self , username : str , action : str , msg : str | None = None ) -> None :
352342 data = {"roomid" : self ._room_id , "username" : username , "action" : action }
353343 if msg :
354344 data ["msg" ] = msg
355345
356- self .event_logger .emit (
357- schema_id = JUPYTER_COLLABORATION_AWARENESS_EVENTS_URI , data = data
358- )
346+ self .event_logger .emit (schema_id = JUPYTER_COLLABORATION_AWARENESS_EVENTS_URI , data = data )
359347
360348 async def _clean_room (self ) -> None :
361349 """
0 commit comments