Skip to content

Commit

Permalink
fix static/lang file fetch and method call
Browse files Browse the repository at this point in the history
  • Loading branch information
marios8543 committed Oct 18, 2023
1 parent 934b1b3 commit 47e9708
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions backend/src/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,12 @@ async def enable_reload_wait(self):
self.watcher.disabled = False

async def handle_frontend_assets(self, request: web.Request):
file = path.join(path.dirname(__file__), "..", "static", request.match_info["path"])

file = Path(__file__).parents[1].joinpath("static").joinpath(request.match_info["path"])
return web.FileResponse(file, headers={"Cache-Control": "no-cache"})

async def handle_frontend_locales(self, request: web.Request):
req_lang = request.match_info["path"]
file = path.join(path.dirname(__file__), "..", "locales", req_lang)
file = Path(__file__).parents[1].joinpath("locales").joinpath(req_lang)
if exists(file):
return web.FileResponse(file, headers={"Cache-Control": "no-cache", "Content-Type": "application/json"})
else:
Expand Down Expand Up @@ -143,7 +142,7 @@ def import_plugin(self, file: str, plugin_directory: str, refresh: bool | None =
self.plugins.pop(plugin.name, None)
if plugin.passive:
self.logger.info(f"Plugin {plugin.name} is passive")
self.plugins[plugin.name] = plugin
self.plugins[plugin.name] = plugin.start()
self.logger.info(f"Loaded {plugin.name}")
if not batch:
self.loop.create_task(self.dispatch_plugin(plugin.name, plugin.version))
Expand Down
2 changes: 1 addition & 1 deletion backend/src/plugin/method_call_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ async def wait_for_result(self):
await self.event.wait()
if not self.response.success:
raise Exception(self.response.result)
return self.response
return self.response.result

0 comments on commit 47e9708

Please sign in to comment.