1 # Manifold API Python interface
4 from myslice.config import Config
10 def __init__(self, auth=None, cainfo=None):
14 self.server = config.manifold_server
15 self.port = config.manifold_port
16 self.path = config.manifold_path
21 self.multicall = False
22 self.url = config.manifold_url()
23 self.proxy = xmlrpclib.Server(self.url, verbose=False, allow_none=True)
25 def __getattr__(self, methodName):
26 def func(*args, **kwds):
27 result=getattr(self.proxy, methodName)(self.auth, *args, **kwds)
30 print '===> backend call',methodName, self.auth, self.url,'->',
31 if not result: print "no/empty result"
32 elif isinstance (result,str): print "result is '%s'"%result
33 elif isinstance (result,list): print "result is a %d-elts list"%len(result)
34 else: print "dont know how to display result"
40 def send_manifold_query (self, manifold_query):
41 (action,method)= (manifold_query.action,manifold_query.method)
43 return self.proxy.Get(self.auth, method, manifold_query.filters, {}, manifold_query.fields)
45 elif action=='others':