From 40978b1456a978c7ea8e61ab9f72f368c7b9d53d Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Tue, 19 Mar 2013 15:38:42 +0100 Subject: [PATCH] rename api into proxy --- manifold/manifoldapi.py | 12 +++++------- manifold/manifoldproxy.py | 6 +++--- myslice/urls.py | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/manifold/manifoldapi.py b/manifold/manifoldapi.py index 40f3e0c0..e482c2dc 100644 --- a/manifold/manifoldapi.py +++ b/manifold/manifoldapi.py @@ -17,11 +17,11 @@ class ManifoldAPI: self.calls = {} self.multicall = False self.url = config.manifold_url - self.proxy = xmlrpclib.Server(self.url, verbose=False, allow_none=True) + self.server = xmlrpclib.Server(self.url, verbose=False, allow_none=True) def __getattr__(self, methodName): def func(*args, **kwds): - result=getattr(self.proxy, methodName)(self.auth, *args, **kwds) + result=getattr(self.server, methodName)(self.auth, *args, **kwds) ### debug if debug: print '===> backend call',methodName, self.auth, self.url,'->', @@ -33,13 +33,11 @@ class ManifoldAPI: return result return func - # 4amine : xxx def send_manifold_query (self, manifold_query): (action,method)= (manifold_query.action,manifold_query.method) if action=='get': - return self.proxy.Get(self.auth, method, manifold_query.filters, {}, manifold_query.fields) + return self.server.Get(self.auth, method, manifold_query.filters, {}, manifold_query.fields) # xxx... - elif action=='others': - return None - + else: + print "WARNING: ManifoldAPI.send_manifold_query: only 'get' implemented for now" diff --git a/manifold/manifoldproxy.py b/manifold/manifoldproxy.py index 3b3ba0fb..4bce287e 100644 --- a/manifold/manifoldproxy.py +++ b/manifold/manifoldproxy.py @@ -14,9 +14,9 @@ debug_spin=0 # see also # myslice/urls.py # as well as -# static/js/manifold-async.js -def api (request,format): - """the view associated with /manifold/api/ +# static/js/manifold.js +def proxy (request,format): + """the view associated with /manifold/proxy/ with the query passed using POST""" # expecting a POST diff --git a/myslice/urls.py b/myslice/urls.py index c3fababc..669961fd 100644 --- a/myslice/urls.py +++ b/myslice/urls.py @@ -38,7 +38,7 @@ urlpatterns = patterns( # # the manifold proxy # - (r'^manifold/api/(?P\w+)/?$', 'manifold.manifoldproxy.api'), + (r'^manifold/proxy/(?P\w+)/?$', 'manifold.manifoldproxy.proxy'), # # various trash views # -- 2.43.0