From 004a80bfaad38f9400e8aebcb8f980353a232295 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 1 Dec 2014 23:53:07 +0100 Subject: PEP-8, Python Zen, refactor and reduce code (thx FedeG) --- pyload/webui/app/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pyload/webui/app/api.py') diff --git a/pyload/webui/app/api.py b/pyload/webui/app/api.py index 286061c2a..9726902fb 100644 --- a/pyload/webui/app/api.py +++ b/pyload/webui/app/api.py @@ -60,7 +60,7 @@ def callApi(func, *args, **kwargs): return HTTPError(404, json.dumps("Not Found")) result = getattr(PYLOAD, func)(*[literal_eval(x) for x in args], - **dict([(x, literal_eval(y)) for x, y in kwargs.iteritems()])) + **dict((x, literal_eval(y)) for x, y in kwargs.iteritems())) # null is invalid json response if result is None: result = True @@ -88,7 +88,7 @@ def login(): try: sid = s._headers["cookie_out"].split("=")[1].split(";")[0] return json.dumps(sid) - except: + except Exception: return json.dumps(True) -- cgit v1.2.3