BAPSicle/patches/1-presenter-build-path.patch

35 lines
1.1 KiB
Diff
Raw Normal View History

2024-04-01 00:16:39 +00:00
diff --git a/web_server.py b/web_server.py
2024-04-01 00:30:28 +00:00
index ccc3979..2909ff8 100644
2024-04-01 00:16:39 +00:00
--- a/web_server.py
+++ b/web_server.py
2024-04-01 00:30:28 +00:00
@@ -32,7 +32,7 @@ import package
from baps_types.happytime import happytime
env = Environment(
- loader=FileSystemLoader("%s/ui-templates/" % os.path.dirname(__file__)),
+ loader=FileSystemLoader("@ui_templates@"),
autoescape=select_autoescape(),
)
@@ -444,16 +444,16 @@ async def audio_file(request, type: str, id: int):
# Static Files
app.static(
- "/favicon.ico", resolve_local_file_path("ui-static/favicon.ico"), name="ui-favicon"
+ "/favicon.ico", "@ui_static@/favicon.ico", name="ui-favicon"
)
-app.static("/static", resolve_local_file_path("ui-static"), name="ui-static")
+app.static("/static", "@ui_static@", name="ui-static")
2024-04-01 00:16:39 +00:00
-dist_directory = resolve_local_file_path("presenter-build")
+dist_directory = "@baps_presenter@";
app.static("/presenter", dist_directory)
app.static(
"/presenter/",
- resolve_local_file_path("presenter-build/index.html"),
+ "@baps_presenter@/index.html",
strict_slashes=True,
name="presenter-index",
)