diff options
Diffstat (limited to 'backend/main.py')
| -rw-r--r-- | backend/main.py | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/backend/main.py b/backend/main.py index dfbf1829..1f365fe5 100644 --- a/backend/main.py +++ b/backend/main.py @@ -36,10 +36,15 @@ CONFIG = { "server_host": getenv("SERVER_HOST", "127.0.0.1"), "server_port": int(getenv("SERVER_PORT", "1337")), "live_reload": getenv("LIVE_RELOAD", "1") == "1", - "log_level": {"CRITICAL": 50, "ERROR": 40, "WARNING":30, "INFO": 20, "DEBUG": 10}[getenv("LOG_LEVEL", "INFO")] + "log_level": {"CRITICAL": 50, "ERROR": 40, "WARNING": 30, "INFO": 20, "DEBUG": 10}[ + getenv("LOG_LEVEL", "INFO") + ], } -basicConfig(level=CONFIG["log_level"], format="[%(module)s][%(levelname)s]: %(message)s") +basicConfig( + level=CONFIG["log_level"], + format="[%(module)s][%(levelname)s]: %(message)s" +) logger = getLogger("Main") @@ -55,11 +60,14 @@ class PluginManager: self.web_app = Application() self.web_app.middlewares.append(csrf_middleware) self.cors = aiohttp_cors.setup(self.web_app, defaults={ - "https://steamloopback.host": aiohttp_cors.ResourceOptions(expose_headers="*", - allow_headers="*", allow_credentials=True) + "https://steamloopback.host": aiohttp_cors.ResourceOptions( + expose_headers="*", + allow_headers="*", + allow_credentials=True + ) }) self.plugin_loader = Loader(self.web_app, CONFIG["plugin_path"], self.loop, CONFIG["live_reload"]) - self.plugin_browser = PluginBrowser(CONFIG["plugin_path"], self.web_app, self.plugin_loader.plugins) + self.plugin_browser = PluginBrowser(CONFIG["plugin_path"], self.plugin_loader.plugins) self.settings = SettingsManager("loader", path.join(HOMEBREW_PATH, "settings")) self.utilities = Utilities(self) self.updater = Updater(self) @@ -75,7 +83,7 @@ class PluginManager: self.web_app.add_routes([get("/auth/token", self.get_auth_token)]) for route in list(self.web_app.router.routes()): - self.cors.add(route) + self.cors.add(route) self.web_app.add_routes([static("/static", path.join(path.dirname(__file__), 'static'))]) self.web_app.add_routes([static("/legacy", path.join(path.dirname(__file__), 'legacy'))]) @@ -99,7 +107,7 @@ class PluginManager: async def load_plugins(self): await self.wait_for_server() self.plugin_loader.import_plugins() - #await inject_to_tab("SP", "window.syncDeckyPlugins();") + # await inject_to_tab("SP", "window.syncDeckyPlugins();") async def loader_reinjector(self): await sleep(2) |
