From 6f8b5347dfa119a3df21f4ca8ba8c2b1537a726a Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sun, 6 Jan 2013 15:54:52 +0100 Subject: first working parts of config api --- module/web/api_app.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/web/api_app.py') 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 -- cgit v1.2.3