diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-10-02 22:58:50 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-10-02 22:58:50 +0200 |
commit | 82e672c0eb27927171cad10101b6be4810b18ed7 (patch) | |
tree | f81cb225513710247958c9a18014405011c0d584 | |
parent | improved accountmanager (diff) | |
download | pyload-82e672c0eb27927171cad10101b6be4810b18ed7.tar.xz |
formated output
-rw-r--r-- | module/plugins/Account.py | 8 | ||||
-rw-r--r-- | module/web/pyload/views.py | 15 |
2 files changed, 18 insertions, 5 deletions
diff --git a/module/plugins/Account.py b/module/plugins/Account.py index 5e86488d7..6260ac3c7 100644 --- a/module/plugins/Account.py +++ b/module/plugins/Account.py @@ -80,11 +80,9 @@ class Account(): infos = {"error": str(e)} self.core.log.debug("Account Info: %s" % str(infos)) self.infos[name] = infos - data.update(infos) - return data - else: - data.update(self.infos[name]) - return data + + data.update(self.infos[name]) + return data def loadAccountInfo(self, name): return { diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index e1f4e2fdd..cdf0e280f 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -10,6 +10,7 @@ from os.path import join from urllib import unquote from itertools import chain from datetime import datetime +from time import localtime, strftime from django.conf import settings from django.contrib.auth.decorators import login_required @@ -327,6 +328,20 @@ def config(request): messages.append(_("All options were set correctly.")) accs = settings.PYLOAD.get_accounts() + for user,data in accs.iteritems(): + if data["trafficleft"] == -1: + data["trafficleft"] = _("unlimited") + elif not data["trafficleft"]: + data["trafficleft"] = "" + + if data["validuntil"] == -1: + data["validuntil"] = _("unlimited") + elif not data["validuntil"]: + data["validuntil"] = "" + else: + t = localtime(data["validuntil"]) + data["validuntil"] = strftime("%d-%m-%Y",t) + return render_to_response(join(settings.TEMPLATE, 'settings.html'), RequestContext(request, {'conf': {'Plugin':plugin, 'General':conf, 'Accounts': accs}, 'errors': messages}, [status_proc])) |