1 # Manifold API Python interface
4 from myslice.config import Config
10 def __init__(self, auth=None, cainfo=None):
18 self.multicall = False
19 self.url = config.manifold_url
20 self.proxy = xmlrpclib.Server(self.url, verbose=False, allow_none=True)
22 def __getattr__(self, methodName):
23 def func(*args, **kwds):
24 result=getattr(self.proxy, methodName)(self.auth, *args, **kwds)
27 print '===> backend call',methodName, self.auth, self.url,'->',
28 if not result: print "no/empty result"
29 elif isinstance (result,str): print "result is '%s'"%result
30 elif isinstance (result,list): print "result is a %d-elts list"%len(result)
31 else: print "dont know how to display result"
37 def send_manifold_query (self, manifold_query):
38 (action,method)= (manifold_query.action,manifold_query.method)
40 return self.proxy.Get(self.auth, method, manifold_query.filters, {}, manifold_query.fields)
42 elif action=='others':