app: report asset path location

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2022-08-17 14:03:45 -04:00
parent 942d595bc2
commit 2314ea74c2
No known key found for this signature in database
GPG Key ID: 5A1EB336DFB4C71B
1 changed files with 5 additions and 2 deletions

View File

@ -67,6 +67,7 @@ EXCLUDED_ARGS = ["_", "token", "access_token", "connection_id"]
AUTHORIZED_EXTS = [".png"]
DEFAULT_KLIPPY_LOG_PATH = "/tmp/klippy.log"
ALL_TRANSPORTS = ["http", "websocket", "mqtt", "internal"]
ASSET_PATH = pathlib.Path(__file__).parent.joinpath("assets")
class MutableRouter(tornado.web.ReversibleRuleRouter):
def __init__(self, application: MoonrakerApp) -> None:
@ -281,6 +282,9 @@ class MoonrakerApp:
def get_server(self) -> Server:
return self.server
def get_asset_path(self) -> pathlib.Path:
return ASSET_PATH
async def close(self) -> None:
if self.http_server is not None:
self.http_server.stop()
@ -1020,5 +1024,4 @@ class WelcomeHandler(tornado.web.RequestHandler):
self.render("welcome.html", **context)
def get_template_path(self) -> Optional[str]:
tpath = pathlib.Path(__file__).parent.joinpath("assets")
return str(tpath)
return str(ASSET_PATH)