diff options
Diffstat (limited to 'module')
-rw-r--r-- | module/download_thread.py | 3 | ||||
-rwxr-xr-x | module/network/Request.py | 1 | ||||
-rw-r--r-- | module/web/WebServer.py | 26 | ||||
-rw-r--r-- | module/web/templates/default.tpl | 12 |
4 files changed, 39 insertions, 3 deletions
diff --git a/module/download_thread.py b/module/download_thread.py index 27abe919d..36b308217 100644 --- a/module/download_thread.py +++ b/module/download_thread.py @@ -76,7 +76,8 @@ class Download_Thread(threading.Thread): except Reconnect: pass except Exception, e: - traceback.print_exc() + if self.parent.parent.config['general']['debug_mode']: + traceback.print_exc() self.loadedPyFile.status.type = "failed" self.loadedPyFile.status.error = str(e) finally: diff --git a/module/network/Request.py b/module/network/Request.py index 85aa851fe..99c04e055 100755 --- a/module/network/Request.py +++ b/module/network/Request.py @@ -8,7 +8,6 @@ authored by: RaNaN import base64 import cookielib from gzip import GzipFile -import re import time import urllib diff --git a/module/web/WebServer.py b/module/web/WebServer.py index 074ab4242..0627132c8 100644 --- a/module/web/WebServer.py +++ b/module/web/WebServer.py @@ -111,7 +111,7 @@ def queue(): username = request.COOKIES.get('user') - return template('default', page='queue', links=core.get_downloads(), user=username, status=core.server_status()) + return template('default', page='queue', links=core.get_links(), user=username, status=core.server_status()) @route('/downloads') def downloads(): @@ -191,6 +191,29 @@ def add_links(): return "{}" +@route('/json/pause') +def pause(): + response.header['Cache-Control'] = 'no-cache, must-revalidate' + response.content_type = 'application/json' + + if not check_auth(request): + abort(404, "No Access") + + core.thread_list.pause = True + + return "{}" + +@route('/json/pause') +def pause(): + response.header['Cache-Control'] = 'no-cache, must-revalidate' + response.content_type = 'application/json' + + if not check_auth(request): + abort(404, "No Access") + + core.thread_liste.pause = False + + return "{}" @route('/favicon.ico') @@ -245,6 +268,7 @@ class WebServer(threading.Thread): else: bottle.debug(False) + #@TODO remove TIME = time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.localtime()) bottle.TEMPLATE_PATH.append('./module/web/templates/%s.tpl') diff --git a/module/web/templates/default.tpl b/module/web/templates/default.tpl index 2508455cb..b184f4017 100644 --- a/module/web/templates/default.tpl +++ b/module/web/templates/default.tpl @@ -180,6 +180,18 @@ this.morph({'color': '#000', 'padding-left': '0px'}); <b>You were successfully logged in</b> +%elif page=="queue": + +<ul> + +%for id in links['order']: + + +<li>{{links[id].url}}</li> + +%end + +</ul> %end |