summaryrefslogtreecommitdiffstats
path: root/pyload/web/pyload_app.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-06-11 23:33:12 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-06-11 23:33:12 +0200
commitfd11ed199c7ac88fd33e300812ea9faf2d70e088 (patch)
treeffab23ee09217e3f08e66db0b0687e0a55bf249e /pyload/web/pyload_app.py
parentseparated setup and paver (diff)
downloadpyload-fd11ed199c7ac88fd33e300812ea9faf2d70e088.tar.xz
working build-script, needs some improvements
Diffstat (limited to 'pyload/web/pyload_app.py')
-rw-r--r--pyload/web/pyload_app.py21
1 files changed, 4 insertions, 17 deletions
diff --git a/pyload/web/pyload_app.py b/pyload/web/pyload_app.py
index 724fddec2..3d3f297a8 100644
--- a/pyload/web/pyload_app.py
+++ b/pyload/web/pyload_app.py
@@ -17,27 +17,14 @@
@author: RaNaN
"""
import time
-from os.path import join, exists
+from os.path import join
from bottle import route, static_file, response, redirect
-from webinterface import PROJECT_DIR, SETUP, DEVELOP
+from webinterface import PROJECT_DIR, SETUP, APP_PATH, UNAVAILALBE
from utils import login_required
-##########
-# Helper
-##########
-
-app_path = "app"
-UNAVAILALBE = False
-
-# webUI build is available
-if exists(join(PROJECT_DIR, "dist", "index.html")) and not DEVELOP:
- app_path = "dist"
-elif not exists(join(PROJECT_DIR, "app", "components")) or not exists(join(PROJECT_DIR, ".tmp")):
- UNAVAILALBE = True
-
@route('/icons/<path:path>')
def serve_icon(path):
@@ -70,9 +57,9 @@ def server_static(path):
response.headers['Expires'] = time.strftime("%a, %d %b %Y %H:%M:%S GMT",
time.gmtime(time.time() + 60 * 60 * 24 * 7))
response.headers['Cache-control'] = "public"
- resp = static_file(path, root=join(PROJECT_DIR, app_path))
+ resp = static_file(path, root=join(PROJECT_DIR, APP_PATH))
# Also serve from .tmp folder in dev mode
- if resp.status_code == 404 and app_path == "app":
+ if resp.status_code == 404 and APP_PATH == "app":
return static_file(path, root=join(PROJECT_DIR, '.tmp'))
return resp \ No newline at end of file