mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-07-11 08:32:03 +00:00
treewide: fix package structure
The static files need to be inside the module to be installed correctly as part of the module.
This commit is contained in:
@@ -106,12 +106,12 @@ class Loader:
|
||||
self.watcher.disabled = False
|
||||
|
||||
async def handle_frontend_assets(self, request: web.Request):
|
||||
file = Path(__file__).parents[1].joinpath("static").joinpath(request.match_info["path"])
|
||||
file = Path(__file__).parent.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(__file__).parents[1].joinpath("locales").joinpath(req_lang)
|
||||
file = Path(__file__).parent.joinpath("locales").joinpath(req_lang)
|
||||
if exists(file):
|
||||
return web.FileResponse(file, headers={"Cache-Control": "no-cache", "Content-Type": "application/json"})
|
||||
else:
|
||||
|
||||
@@ -88,7 +88,7 @@ class PluginManager:
|
||||
|
||||
for route in list(self.web_app.router.routes()):
|
||||
self.cors.add(route) # pyright: ignore [reportUnknownMemberType]
|
||||
self.web_app.add_routes([static("/static", path.join(path.dirname(__file__), '..', 'static'))])
|
||||
self.web_app.add_routes([static("/static", path.join(path.dirname(__file__), 'static'))])
|
||||
|
||||
def exception_handler(self, loop: AbstractEventLoop, context: Dict[str, str]):
|
||||
if context["message"] == "Unclosed connection":
|
||||
|
||||
@@ -6,8 +6,8 @@ from PyInstaller.utils.hooks import copy_metadata
|
||||
a = Analysis(
|
||||
['main.py'],
|
||||
datas=[
|
||||
('locales', 'locales'),
|
||||
('static', 'static'),
|
||||
('decky_loader/locales', 'decky_loader/locales'),
|
||||
('decky_loader/static', 'decky_loader/static'),
|
||||
] + copy_metadata('decky_loader'),
|
||||
hiddenimports=['logging.handlers', 'sqlite3', 'decky_plugin', 'decky'],
|
||||
)
|
||||
|
||||
@@ -8,7 +8,10 @@ packages = [
|
||||
{include = "decky_loader"},
|
||||
{include = "decky_loader/main.py"}
|
||||
]
|
||||
include = ["decky_loader/static/*"]
|
||||
include = [
|
||||
"decky_loader/locales/*",
|
||||
"decky_loader/static/*"
|
||||
]
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = ">=3.10,<3.13"
|
||||
|
||||
Reference in New Issue
Block a user