diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-12-22 23:45:38 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-12-22 23:45:38 +0100 |
commit | 958bf611f5d9d117f19f824990ec6fd6b537e967 (patch) | |
tree | 558cb45fa61b1738629dff9727c028badccd9990 /module/web | |
parent | some bugfixes (diff) | |
download | pyload-958bf611f5d9d117f19f824990ec6fd6b537e967.tar.xz |
accountmanager v2, delete your accounts.conf and re-enter them in pyload,
new nice debug functions, try core.shell() and core.breakpoint()
Diffstat (limited to 'module/web')
-rw-r--r-- | module/web/json_app.py | 4 | ||||
-rw-r--r-- | module/web/pyload_app.py | 28 | ||||
-rw-r--r-- | module/web/templates/default/settings.html | 32 | ||||
-rw-r--r-- | module/web/templates/default/settings_item.html | 2 |
4 files changed, 31 insertions, 35 deletions
diff --git a/module/web/json_app.py b/module/web/json_app.py index 196c9e36d..e02aa0707 100644 --- a/module/web/json_app.py +++ b/module/web/json_app.py @@ -278,9 +278,9 @@ def update_accounts(): if action == "password": PYLOAD.updateAccount(plugin, user, value) elif action == "time" and "-" in value: - PYLOAD.updateAccount(plugin, user, options={"time": [value]}) + PYLOAD.updateAccount(plugin, user, options={"time": value}) elif action == "limitdl" and value.isdigit(): - PYLOAD.updateAccount(plugin, user, options={"limitDL": [value]}) + PYLOAD.updateAccount(plugin, user, options={"limitDL": value}) elif action == "delete": deleted.append((plugin,user)) PYLOAD.removeAccount(plugin, user) 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', diff --git a/module/web/templates/default/settings.html b/module/web/templates/default/settings.html index a4443025a..be320970b 100644 --- a/module/web/templates/default/settings.html +++ b/module/web/templates/default/settings.html @@ -102,18 +102,18 @@ {% for account in conf.accs %} - {% set plugin = account.type %} + {% set plugin = account.__name__ %} <tr> <td> <span style="padding:5px">{{ plugin }}</span> </td> - <td><label for="{{plugin}}|password;{{account.login}}" - style="color:#424242;">{{ account.login }}</label></td> + <td><label for="{{plugin}}|password;{{account.loginname}}" + style="color:#424242;">{{ account.loginname }}</label></td> <td> - <input id="{{plugin}}|password;{{account.login}}" - name="{{plugin}}|password;{{account.login}}" - type="password" value="{{account.password}}" size="12"/> + <input id="{{plugin}}|password;{{account.loginname}}" + name="{{plugin}}|password;{{account.loginname}}" + type="password" value="" size="12"/> </td> <td> {% if account.valid %} @@ -137,27 +137,27 @@ </td> <td> <span style="font-weight: bold;"> - {{ account.validuntil }} + {{ account._validuntil }} </span> </td> <td> <span style="font-weight: bold;"> - {{ account.trafficleft }} + {{ account._trafficleft }} </span> </td> <td> - <input id="{{plugin}}|time;{{account.login}}" - name="{{plugin}}|time;{{account.login}}" type="text" - size="7" value="{{account.time}}"/> + <input id="{{plugin}}|time;{{account.loginname}}" + name="{{plugin}}|time;{{account.loginname}}" type="text" + size="7" value="{{account.options.time}}"/> </td> <td> - <input id="{{plugin}}|limitdl;{{account.login}}" - name="{{plugin}}|limitdl;{{account.login}}" type="text" - size="2" value="{{account.limitdl}}"/> + <input id="{{plugin}}|limitdl;{{account.loginname}}" + name="{{plugin}}|limitdl;{{account.loginname}}" type="text" + size="2" value="{{account.options.limitdl}}"/> </td> <td> - <input id="{{plugin}}|delete;{{account.login}}" - name="{{plugin}}|delete;{{account.login}}" type="checkbox" + <input id="{{plugin}}|delete;{{account.loginname}}" + name="{{plugin}}|delete;{{account.loginname}}" type="checkbox" value="True"/> </td> </tr> diff --git a/module/web/templates/default/settings_item.html b/module/web/templates/default/settings_item.html index b81ba1b95..b3d7fe334 100644 --- a/module/web/templates/default/settings_item.html +++ b/module/web/templates/default/settings_item.html @@ -1,5 +1,5 @@ <table class="settable"> - {% if section.outline %} + {% if section.description %} <tr><th colspan="2">{{ section.description }}</th></tr> {% endif %} {% for option in section.items %} |