summaryrefslogtreecommitdiffstats
path: root/module/web/webinterface.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-08-26 23:30:22 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-08-26 23:30:22 +0200
commit1edbca46b0aef5d6bc9ca2d8c28dd32a7e7e9cf5 (patch)
tree20be87efcda4501b17fca9056628aa92985445d7 /module/web/webinterface.py
parentVersion number: 0.4.10 (diff)
downloadpyload-1edbca46b0aef5d6bc9ca2d8c28dd32a7e7e9cf5.tar.xz
Diffstat (limited to 'module/web/webinterface.py')
-rw-r--r--module/web/webinterface.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/module/web/webinterface.py b/module/web/webinterface.py
index 13edd8a5e..b757b74f2 100644
--- a/module/web/webinterface.py
+++ b/module/web/webinterface.py
@@ -23,8 +23,8 @@ import os
from os.path import join, abspath, dirname, exists
from os import makedirs
-PROJECT_DIR = abspath(dirname(__file__))
-PYLOAD_DIR = abspath(join(PROJECT_DIR, "..", ".."))
+THEME_DIR = abspath(join(dirname(__file__), "themes"))
+PYLOAD_DIR = abspath(join(THEME_DIR, "..", "..", ".."))
sys.path.append(PYLOAD_DIR)
@@ -56,7 +56,7 @@ from module.common.JsEngine import JsEngine
JS = JsEngine()
-TEMPLATE = config.get('webinterface', 'template')
+THEME = config.get('webinterface', 'theme')
DL_ROOT = config.get('general', 'download_folder')
LOG_ROOT = config.get('log', 'log_folder')
PREFIX = config.get('webinterface', 'prefix')
@@ -74,13 +74,11 @@ if not exists(cache):
makedirs(cache)
bcc = FileSystemBytecodeCache(cache, '%s.cache')
-loader = PrefixLoader({
- TEMPLATE: FileSystemLoader(join(PROJECT_DIR, "templates", TEMPLATE)),
- 'js': FileSystemLoader(join(PROJECT_DIR, 'media', 'js'))
-})
+
+loader = FileSystemLoader(THEME_DIR)
env = Environment(loader=loader, extensions=['jinja2.ext.i18n', 'jinja2.ext.autoescape'], trim_blocks=True, auto_reload=False,
- bytecode_cache=bcc)
+ bytecode_cache=bcc)
from filters import quotepath, path_make_relative, path_make_absolute, truncate, date