summaryrefslogtreecommitdiff
path: root/backend/src
diff options
context:
space:
mode:
authorParty Wumpus <48649272+PartyWumpus@users.noreply.github.com>2024-05-30 08:14:03 +0100
committerPartyWumpus <48649272+PartyWumpus@users.noreply.github.com>2024-05-30 08:18:54 +0100
commit3a83fa81def62c2ee3d9bedc3a78c00073d8fdb6 (patch)
tree9828c536d49e8f313760263fbc076c4eb92b7f90 /backend/src
parent5053a52f32c161910d09e735ba5d7c52299d004e (diff)
downloaddecky-loader-3a83fa81def62c2ee3d9bedc3a78c00073d8fdb6.tar.gz
decky-loader-3a83fa81def62c2ee3d9bedc3a78c00073d8fdb6.zip
Typing fix
linters are the light of my life
Diffstat (limited to 'backend/src')
-rw-r--r--backend/src/loader.py8
-rw-r--r--backend/src/main.py2
2 files changed, 5 insertions, 5 deletions
diff --git a/backend/src/loader.py b/backend/src/loader.py
index e59cbcaf..c5c4bd8d 100644
--- a/backend/src/loader.py
+++ b/backend/src/loader.py
@@ -5,7 +5,7 @@ from logging import getLogger
from os import listdir, path
from pathlib import Path
from traceback import print_exc
-from typing import Any, Tuple
+from typing import Any, Tuple, cast
from aiohttp import web
from os.path import exists
@@ -38,7 +38,7 @@ class FileChangeHandler(RegexMatchingEventHandler):
self.queue.put_nowait((path.join(self.plugin_path, plugin_dir, "main.py"), plugin_dir, True))
def on_created(self, event: DirCreatedEvent | FileCreatedEvent):
- src_path = event.src_path
+ src_path = cast(str, event.src_path) #type: ignore # this is the correct type for this is in later versions of watchdog
if "__pycache__" in src_path:
return
@@ -52,7 +52,7 @@ class FileChangeHandler(RegexMatchingEventHandler):
self.maybe_reload(src_path)
def on_modified(self, event: DirModifiedEvent | FileModifiedEvent):
- src_path = event.src_path
+ src_path = cast(str, event.src_path) # type: ignore
if "__pycache__" in src_path:
return
@@ -235,4 +235,4 @@ class Loader:
await self.reload_queue.put((plugin.file, plugin.plugin_directory))
- return web.Response(status=200) \ No newline at end of file
+ return web.Response(status=200)
diff --git a/backend/src/main.py b/backend/src/main.py
index 76bb897f..cf92310f 100644
--- a/backend/src/main.py
+++ b/backend/src/main.py
@@ -25,7 +25,7 @@ from .browser import PluginBrowser
from .helpers import (REMOTE_DEBUGGER_UNIT, csrf_middleware, get_csrf_token,
mkdir_as_user, get_system_pythonpaths, get_effective_user_id)
-from .injector import get_gamepadui_tab, Tab, close_old_tabs
+from .injector import get_gamepadui_tab, Tab
from .loader import Loader
from .settings import SettingsManager
from .updater import Updater