X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=engine%2Fmanifoldapi.py;h=40f3e0c0c8f894e70c62aeb34d322163c7c6090a;hb=557959f0e08f90646409d70f0231186d7a612c34;hp=b125a595e264bfb3a83d54a599b59e00ae7054f0;hpb=a222cef0a10a5517349f05cea0e382b35e3a14a6;p=unfold.git diff --git a/engine/manifoldapi.py b/engine/manifoldapi.py index b125a595..40f3e0c0 100644 --- a/engine/manifoldapi.py +++ b/engine/manifoldapi.py @@ -1,5 +1,6 @@ # Manifold API Python interface import xmlrpclib + from myslice.config import Config debug=True @@ -10,20 +11,35 @@ class ManifoldAPI: config = Config() self.auth = auth - self.server = config.manifold_server - self.port = config.manifold_port - self.path = config.manifold_path self.cainfo = cainfo self.errors = [] self.trace = [] self.calls = {} self.multicall = False - self.url = config.manifold_url() + self.url = config.manifold_url self.proxy = 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) - if debug: print methodName, self.auth, self.url,'->',result + ### debug + if debug: + print '===> backend call',methodName, self.auth, self.url,'->', + if not result: print "no/empty result" + elif isinstance (result,str): print "result is '%s'"%result + elif isinstance (result,list): print "result is a %d-elts list"%len(result) + else: print "dont know how to display result" + ### 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) + # xxx... + elif action=='others': + return None + +