From 53865e7411fa0528093cbfa5f4ba7591e71f2ef8 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Wed, 31 Mar 2010 14:27:31 +0200 Subject: parser fix --- module/XMLConfigParser.py | 2 +- module/web/media/default/css/default.css | 69 +++++++++++++++- module/web/pyload/views.py | 4 +- module/web/templates/default/settings.html | 121 +++++++++++++++++++++++++++++ pyLoadCore.py | 19 ++--- 5 files changed, 202 insertions(+), 13 deletions(-) diff --git a/module/XMLConfigParser.py b/module/XMLConfigParser.py index 87b863d28..50214c49a 100644 --- a/module/XMLConfigParser.py +++ b/module/XMLConfigParser.py @@ -42,7 +42,7 @@ class XMLConfigParser(): file = self.file if self.forceDefault: file = self.file_default - if not exists(self.file) or self.forceDefault: + if not exists(self.file): self._copyConfig() with open(file, 'r') as fh: self.xml = parse(fh) diff --git a/module/web/media/default/css/default.css b/module/web/media/default/css/default.css index 24bb9febf..398cb03b6 100644 --- a/module/web/media/default/css/default.css +++ b/module/web/media/default/css/default.css @@ -1227,12 +1227,13 @@ label.simple { label.block input.edit { width:50%; } -fieldset { +/*fieldset { width:300px; text-align:center; padding:0.5em; margin:auto; } +*/ div.editor { margin:0 0 0 0; } @@ -1513,4 +1514,68 @@ div.codearea pre span.Preprc { .header, .header th{ text-align: left; font-weight: normal; -} \ No newline at end of file +} + +#horizontalForm fieldset +{ + display: block; + margin: 0 0 3em 0; + padding: 0 1em 1em 1em; +} + +#horizontalForm fieldset.radio +{ + margin: 1em 0 2em 0; +} + +#horizontalForm fieldset.radio input +{ + clear: both; + float: left; + width: auto; +} + +#horizontalForm fieldset.radio label +{ + font-weight: normal; +} + +#horizontalForm input +{ + display: block; + width: 15em; +} + +#horizontalForm input.submit +{ + clear: both; +} + +#horizontalForm label +{ + float: left; + display: block; + margin: 1em 1em 0 0; + font-weight: bold; +} + +#horizontalForm select +{ + display: block; +} + +.clearer +{ + clear: both; + height: 1px; +} + +.left +{ + float: left; +} + +.right +{ + float: right; +} diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index e8df50596..6dbbd22c6 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -169,4 +169,6 @@ def collector(request): @permission('pyload.can_change_status') @check_server def config(request): - return render_to_response(join(settings.TEMPLATE, 'settings.html'), RequestContext(request, {}, [status_proc])) + conf = settings.PYLOAD.get_config_data() + + return render_to_response(join(settings.TEMPLATE, 'settings.html'), RequestContext(request, {'conf': conf}, [status_proc])) diff --git a/module/web/templates/default/settings.html b/module/web/templates/default/settings.html index ab144bed6..d3d906c47 100644 --- a/module/web/templates/default/settings.html +++ b/module/web/templates/default/settings.html @@ -27,6 +27,127 @@ {% block content %} +{{ conf }} + +

Coming Soon.

+
+ + {% for key, section in conf.items %} + +
+ + {{section.name}} + + + {% for key, option in section.options.items %} + + + {% endfor %} +
+ {% endfor %} + +
+ + Name + + + + +
+
+
+ + + Address + + + + + + +
+
+
+ + Payment details + +
+ + + Credit card + + + + + + +
+
+ + + + +
+ +
+
+ + {% endblock %} \ No newline at end of file diff --git a/pyLoadCore.py b/pyLoadCore.py index e2682c990..643156d25 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -22,7 +22,7 @@ """ CURRENT_VERSION = '0.3.2' -import signal +from copy import deepcopy from getopt import GetoptError from getopt import getopt import gettext @@ -31,13 +31,13 @@ from imp import find_module import logging import logging.handlers from operator import attrgetter +from os import _exit from os import chdir -from os import name as platform from os import execv from os import makedirs +from os import name as platform from os import remove from os import sep -from os import _exit from os import statvfs from os.path import abspath from os.path import basename @@ -46,11 +46,12 @@ from os.path import exists from os.path import isabs from os.path import join from re import sub +import signal import subprocess +import sys from sys import argv from sys import executable from sys import exit -import sys from sys import path from sys import stdout from sys import version_info @@ -436,7 +437,7 @@ class Core(object): def check_update(self): try: if self.config['updates']['search_updates']: - version_check = getURL("http://get.pyload.org/check/%s/" % (CURRENT_VERSION, )) + version_check = getURL("http://get.pyload.org/check/%s/" % (CURRENT_VERSION,)) if version_check == "": self.logger.info(_("No Updates for pyLoad")) return False @@ -454,9 +455,9 @@ class Core(object): try: if self.config['updates']['search_updates']: if self.core.config['updates']['install_updates']: - version_check = getURL("http://get.pyload.org/get/update/%s/" % (CURRENT_VERSION, )) + version_check = getURL("http://get.pyload.org/get/update/%s/" % (CURRENT_VERSION,)) else: - version_check = getURL("http://get.pyload.org/check/%s/" % (CURRENT_VERSION, )) + version_check = getURL("http://get.pyload.org/check/%s/" % (CURRENT_VERSION,)) if version_check == "": return False else: @@ -526,13 +527,13 @@ class ServerMethods(): raise Exception("not allowed!") def get_config(self): - d = self.core.xmlconfig.getConfigDict() + d = deepcopy(self.core.xmlconfig.getConfigDict()) del d["remote"]["username"] del d["remote"]["password"] return d def get_config_data(self): - d = self.core.xmlconfig.getDataDict() + d = deepcopy(self.core.xmlconfig.getDataDict()) del d["remote"]["options"]["username"] del d["remote"]["options"]["password"] return d -- cgit v1.2.3