summaryrefslogtreecommitdiffstats
path: root/module/web/pyload_app.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-12-23 21:40:22 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-12-23 21:40:22 +0100
commit8da44b430b957b25e74dff63829d4198a52e7a0b (patch)
treef20fc60db6e7d9a93fe3ca60cd68a6e32b536fc6 /module/web/pyload_app.py
parentoron version increase (diff)
parentlittle fixes (diff)
downloadpyload-8da44b430b957b25e74dff63829d4198a52e7a0b.tar.xz
merge hotfixes in
Diffstat (limited to 'module/web/pyload_app.py')
-rw-r--r--module/web/pyload_app.py39
1 files changed, 17 insertions, 22 deletions
diff --git a/module/web/pyload_app.py b/module/web/pyload_app.py
index df4a4b3d4..a025f6bcb 100644
--- a/module/web/pyload_app.py
+++ b/module/web/pyload_app.py
@@ -189,7 +189,7 @@ def collector():
def downloads():
root = PYLOAD.getConfigValue("general", "download_folder")
- if not isdir(root):
+ if not isdir(fs_encode(root)):
return base([_('Download directory not found.')])
data = {
'folder': [],
@@ -241,45 +241,40 @@ def get_download(path):
@route("/settings")
@login_required('SETTINGS')
def config():
- conf = PYLOAD.getConfig()
- plugin = PYLOAD.getPluginConfig()
+ conf = PYLOAD.getConfigPointer()
conf_menu = []
plugin_menu = []
- for entry in sorted(conf.keys()):
- conf_menu.append((entry, conf[entry].description))
+ for section, data in conf.getBaseSections():
+ conf_menu.append((section, data.name))
- for entry in sorted(plugin.keys()):
- plugin_menu.append((entry, plugin[entry].description))
+ for section, data in conf.getPluginSections():
+ plugin_menu.append((section, data.name))
accs = PYLOAD.getAccounts(False)
+ # prefix attributes with _, because we would change them directly on the object otherweise
for data in accs:
if data.trafficleft == -1:
- data.trafficleft = _("unlimited")
+ data._trafficleft = _("unlimited")
elif not data.trafficleft:
- data.trafficleft = _("not available")
+ data._trafficleft = _("not available")
else:
- data.trafficleft = formatSize(data.trafficleft * 1024)
+ data._trafficleft = formatSize(data.trafficleft * 1024)
if data.validuntil == -1:
- data.validuntil = _("unlimited")
- elif not data.validuntil :
- data.validuntil = _("not available")
+ data._validuntil = _("unlimited")
+ elif not data.validuntil:
+ data._validuntil = _("not available")
else:
t = time.localtime(data.validuntil)
- data.validuntil = time.strftime("%d.%m.%Y", t)
+ data._validuntil = time.strftime("%d.%m.%Y", t)
- if "time" in data.options:
- try:
- data.options["time"] = data.options["time"][0]
- except:
- data.options["time"] = "0:00-0:00"
+ if not data.options["time"]:
+ data.options["time"] = "0:00-0:00"
- if "limitDL" in data.options:
- data.options["limitdl"] = data.options["limitDL"][0]
- else:
+ if not data.options["limitDL"]:
data.options["limitdl"] = "0"
return render_to_response('settings.html',