]> git.ipfire.org Git - people/jschlag/pbs.git/commitdiff
Load templates and static files from the right locations
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 7 Oct 2017 11:38:59 +0000 (12:38 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 7 Oct 2017 11:39:30 +0000 (12:39 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
src/buildservice/constants.py.in
src/hub/__init__.py
src/web/__init__.py

index b19f33526d5fde12260ae06d1f2515f919c4dcff..a958b9b7ae3777b14ebaa54c62862b8f81afe692 100644 (file)
@@ -457,7 +457,9 @@ substitutions = \
        '|configsdir=$(configsdir)|' \
        '|bindir=$(bindir)|' \
        '|datadir=$(datadir)|' \
-       '|localedir=$(localedir)|'
+       '|localedir=$(localedir)|' \
+       '|templatesdir=$(templatesdir)|' \
+       '|staticdir=$(staticdir)|'
 
 SED_PROCESS = \
        $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
index 7d20ab236b31676c9a8c21d543700126781c9553..7bfc73e1c1aa5d041dfcab83944d1915a8a1e741 100644 (file)
@@ -7,9 +7,11 @@ from pakfire.constants import *
 
 PACKAGE_NAME = "@PACKAGE_NAME@"
 
-CONFIGSDIR = "@configsdir@"
-DATADIR    = "@datadir@"
-LOCALEDIR  = "@localedir@"
+CONFIGSDIR   = "@configsdir@"
+DATADIR      = "@datadir@"
+LOCALEDIR    = "@localedir@"
+TEMPLATESDIR = "@templatesdir@"
+STATICDIR    = "@staticdir@"
 
 PAKFIRE_DIR  = "/pakfire"
 PACKAGES_DIR = os.path.join(PAKFIRE_DIR, "packages")
index 0b2e624763f01e51e5f85004d94997ba39c7287c..fa25c61fd9c04e74d7a621ef223b6ae7ec162f4c 100644 (file)
@@ -11,8 +11,6 @@ from .. import Backend
 
 from . import handlers
 
-BASEDIR = os.path.join(os.path.dirname(__file__), "..", "data")
-
 # Read command line
 tornado.options.define("debug", default=False, help="Run in debug mode", type=bool)
 tornado.options.parse_command_line()
index 82f9fb3c635cca7c3119ecdc05e07fe3876214fe..1ff961038a56b83ae28d52267ee3bbb84fe810d4 100644 (file)
@@ -16,8 +16,6 @@ from . import handlers_api
 from .handlers import *
 from .ui_modules import *
 
-BASEDIR = os.path.join(os.path.dirname(__file__), "..", "data")
-
 # Enable logging
 tornado.options.define("debug", default=False, help="Run in debug mode", type=bool)
 tornado.options.parse_command_line()
@@ -30,7 +28,8 @@ class Application(tornado.web.Application):
                        debug = tornado.options.options.debug,
                        gzip  = True,
                        login_url = "/login",
-                       template_path = os.path.join(BASEDIR, "templates"),
+                       template_path = TEMPLATESDIR,
+                       static_path = STATICDIR,
                        ui_modules = {
                                "Text"               : TextModule,
                                "Modal"              : ModalModule,
@@ -102,7 +101,7 @@ class Application(tornado.web.Application):
 
                tornado.web.Application.__init__(self, **settings)
 
-               self.settings["static_path"] = static_path = os.path.join(BASEDIR, "static")
+               self.settings["static_path"] = static_path = STATICDIR
                static_handlers = [
                        (r"/static/(.*)", tornado.web.StaticFileHandler, dict(path = static_path)),
                        (r"/(favicon\.ico)", tornado.web.StaticFileHandler, dict(path = static_path)),