summaryrefslogtreecommitdiffstats
path: root/pyload/webui
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/webui')
-rw-r--r--pyload/webui/__init__.py16
-rw-r--r--pyload/webui/app/__init__.py2
-rw-r--r--pyload/webui/app/api.py2
-rw-r--r--pyload/webui/app/json.py2
-rw-r--r--pyload/webui/app/pyloadweb.py (renamed from pyload/webui/app/pyload.py)10
5 files changed, 16 insertions, 16 deletions
diff --git a/pyload/webui/__init__.py b/pyload/webui/__init__.py
index 0d2f1ca36..1310c629d 100644
--- a/pyload/webui/__init__.py
+++ b/pyload/webui/__init__.py
@@ -24,20 +24,20 @@ from middlewares import StripPathMiddleware, GZipMiddleWare, PrefixMiddleware
SETUP = None
PYLOAD = None
-from pyload.manager.thread import ServerThread
+from pyload.manager.thread import Server
from pyload.network.JsEngine import JsEngine
-if not ServerThread.core:
- if ServerThread.setup:
- SETUP = ServerThread.setup
+if not Server.core:
+ if Server.setup:
+ SETUP = Server.setup
config = SETUP.config
JS = JsEngine(SETUP)
else:
raise Exception("Could not access pyLoad Core")
else:
- PYLOAD = ServerThread.core.api
- config = ServerThread.core.config
- JS = JsEngine(ServerThread.core)
+ PYLOAD = Server.core.api
+ config = Server.core.config
+ JS = JsEngine(Server.core)
THEME = config.get('webinterface', 'theme')
DL_ROOT = config.get('general', 'download_folder')
@@ -58,7 +58,7 @@ if not exists(cache):
bcc = FileSystemBytecodeCache(cache, '%s.cache')
-loader = FileSystemLoader(THEME_DIR)
+loader = FileSystemLoader([THEME_DIR, join(THEME_DIR, THEME)])
env = Environment(loader=loader, extensions=['jinja2.ext.i18n', 'jinja2.ext.autoescape'], trim_blocks=True, auto_reload=False,
bytecode_cache=bcc)
diff --git a/pyload/webui/app/__init__.py b/pyload/webui/app/__init__.py
index 39d0fadd5..43c9ecbe9 100644
--- a/pyload/webui/app/__init__.py
+++ b/pyload/webui/app/__init__.py
@@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-
-from pyload.webui.app import api, cnl, json, pyload
+from pyload.webui.app import api, cnl, json, pyloadweb
diff --git a/pyload/webui/app/api.py b/pyload/webui/app/api.py
index 1ee4b1608..ceee50c8a 100644
--- a/pyload/webui/app/api.py
+++ b/pyload/webui/app/api.py
@@ -6,7 +6,7 @@ from traceback import format_exc, print_exc
from bottle import route, request, response, HTTPError
-from pyload.utils import toDict, set_session
+from pyload.webui.app.utils import toDict, set_session
from pyload.webui import PYLOAD
from pyload.utils import json
diff --git a/pyload/webui/app/json.py b/pyload/webui/app/json.py
index c347c25e3..b61f57a8c 100644
--- a/pyload/webui/app/json.py
+++ b/pyload/webui/app/json.py
@@ -8,7 +8,7 @@ from bottle import route, request, HTTPError
from pyload.webui import PYLOAD
-from pyload.utils import login_required, render_to_response, toDict
+from pyload.webui.app.utils import login_required, render_to_response, toDict
from pyload.utils import decode, formatSize
diff --git a/pyload/webui/app/pyload.py b/pyload/webui/app/pyloadweb.py
index a52f9d05f..d7604918b 100644
--- a/pyload/webui/app/pyload.py
+++ b/pyload/webui/app/pyloadweb.py
@@ -14,9 +14,9 @@ from urllib import unquote
from bottle import route, static_file, request, response, redirect, error
-from pyload.webui import PYLOAD, PYLOAD_DIR, THEME_DIR, SETUP, env
+from pyload.webui import PYLOAD, PYLOAD_DIR, THEME_DIR, THEME, SETUP, env
-from pyload.utils import render_to_response, parse_permissions, parse_userdata, \
+from pyload.webui.app.utils import render_to_response, parse_permissions, parse_userdata, \
login_required, get_permission, set_permission, permlist, toDict, set_session
from pyload.webui.filters import relpath, unquotepath
@@ -81,7 +81,7 @@ def error500(error):
@route('/<theme>/<file:re:(.+/)?[^/]+\.min\.[^/]+>')
def server_min(theme, file):
- filename = join(THEME_DIR, theme, file)
+ filename = join(THEME_DIR, THEME, theme, file)
if not isfile(filename):
file = file.replace(".min.", ".")
if file.endswith(".js"):
@@ -90,7 +90,7 @@ def server_min(theme, file):
return server_static(theme, file)
-@route('/<theme>/<file_static:re:.+\.js>')
+@route('/<theme>/<file:re:.+\.js>')
def server_js(theme, file):
response.headers['Content-Type'] = "text/javascript; charset=UTF-8"
@@ -111,7 +111,7 @@ def server_static(theme, file):
time.gmtime(time.time() + 24 * 7 * 60 * 60))
response.headers['Cache-control'] = "public"
- return static_file(file, root=join(THEME_DIR, theme))
+ return static_file(file, root=join(THEME_DIR, THEME, theme))
@route('/favicon.ico')