From 6eae782f13953dd0ba2bbe1b582cf33fd4d7d90a Mon Sep 17 00:00:00 2001 From: RaNaN Date: Mon, 19 Dec 2011 23:10:49 +0100 Subject: configparser v2, warning CONFIG will be DELETED. --- module/web/pyload_app.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'module/web/pyload_app.py') diff --git a/module/web/pyload_app.py b/module/web/pyload_app.py index df4a4b3d4..5e6d18584 100644 --- a/module/web/pyload_app.py +++ b/module/web/pyload_app.py @@ -241,17 +241,16 @@ 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) -- cgit v1.2.3 From 958bf611f5d9d117f19f824990ec6fd6b537e967 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Thu, 22 Dec 2011 23:45:38 +0100 Subject: accountmanager v2, delete your accounts.conf and re-enter them in pyload, new nice debug functions, try core.shell() and core.breakpoint() --- module/web/pyload_app.py | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'module/web/pyload_app.py') diff --git a/module/web/pyload_app.py b/module/web/pyload_app.py index 5e6d18584..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': [], @@ -254,31 +254,27 @@ def config(): 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', -- cgit v1.2.3