From 7328318de8b1ba0b5032366b36ebd1323eb7b5b5 Mon Sep 17 00:00:00 2001 From: YiHungWONG <40423264+yihong1120@users.noreply.github.com> Date: Wed, 4 Dec 2024 05:49:34 +0000 Subject: [PATCH] Modify format to comply flake8 regulation --- examples/YOLO_server_api/app.py | 4 ++++ src/utils.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/YOLO_server_api/app.py b/examples/YOLO_server_api/app.py index 7598106..ae76f11 100644 --- a/examples/YOLO_server_api/app.py +++ b/examples/YOLO_server_api/app.py @@ -44,6 +44,8 @@ sio_app = socketio.ASGIApp(sio, app) # Define Socket.IO events + + @sio.event async def connect(sid: str, environ: dict) -> None: """ @@ -67,6 +69,8 @@ async def disconnect(sid: str) -> None: print('Client disconnected:', sid) # Define lifespan event to manage the application startup and shutdown + + @asynccontextmanager async def lifespan(app: FastAPI) -> AsyncGenerator[None]: """ diff --git a/src/utils.py b/src/utils.py index 1fe581e..821418f 100644 --- a/src/utils.py +++ b/src/utils.py @@ -81,7 +81,8 @@ def on_modified(self, event): if event_path == self.file_path: print(f"[DEBUG] Configuration file modified: {event_path}") asyncio.run_coroutine_threadsafe( - self.callback(), self.loop, # Ensure the callback is run in the loop + # Ensure the callback is run in the loop + self.callback(), self.loop, )