summaryrefslogtreecommitdiffstats
path: root/module/web/api_app.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-01-06 15:54:52 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-01-06 15:54:52 +0100
commit6f8b5347dfa119a3df21f4ca8ba8c2b1537a726a (patch)
tree627c4d99f0aaa4c8022b70b3ebe72f201d924dd6 /module/web/api_app.py
parentremoved unneeded stuff (diff)
downloadpyload-6f8b5347dfa119a3df21f4ca8ba8c2b1537a726a.tar.xz
first working parts of config api
Diffstat (limited to 'module/web/api_app.py')
-rw-r--r--module/web/api_app.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/module/web/api_app.py b/module/web/api_app.py
index ff8d0134c..c0a7df528 100644
--- a/module/web/api_app.py
+++ b/module/web/api_app.py
@@ -46,7 +46,7 @@ def call_api(func, args=""):
kwargs[x] = unquote(y)
try:
- return callApi(func, *args, **kwargs)
+ return callApi(api, func, *args, **kwargs)
except ExceptionObject, e:
return HTTPError(400, dumps(e))
except Exception, e:
@@ -55,13 +55,13 @@ def call_api(func, args=""):
# TODO Better error codes on invalid input
-def callApi(func, *args, **kwargs):
+def callApi(api, func, *args, **kwargs):
if not hasattr(PYLOAD.EXTERNAL, func) or func.startswith("_"):
print "Invalid API call", func
return HTTPError(404, dumps("Not Found"))
# TODO: encoding
- result = getattr(PYLOAD, func)(*[loads(x) for x in args],
+ result = getattr(api, func)(*[loads(x) for x in args],
**dict([(x, loads(y)) for x, y in kwargs.iteritems()]))
# null is invalid json response