X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=manifold%2Fmanifoldapi.py;h=2548287fd69d326f8801b6a2067d8e63b8ce96f7;hb=9e6b289bad3042093d0414ed90a336aaa5bfa09a;hp=c0870ecae2867536b19323715e1ad32cb6b775ef;hpb=f14a5114d0cf6673c172bdb89669fa80efcd3f2b;p=myslice.git diff --git a/manifold/manifoldapi.py b/manifold/manifoldapi.py index c0870eca..2548287f 100644 --- a/manifold/manifoldapi.py +++ b/manifold/manifoldapi.py @@ -44,7 +44,7 @@ class ManifoldAPI: # XXX jordan : we need to wrap it into a ResultValue structure # XXX this is not good until we merge both repos if result['code'] != 2: - return ManifoldResult(code=result['code'], value=result['result']) + return ManifoldResult(code=result['code'], value=result['value']) else: return ManifoldResult(code=result['code'], output=result['description']) else: @@ -76,25 +76,9 @@ class ManifoldAPI: def send_manifold_query (self, query): # We use a dictionary representation of the query for forwarding it to the API ret = self.forward(query.to_dict()) - print "="*80 - print "Result:" - print ret - print "="*80 - print ret + if debug: + print "="*80 + print "Result:" + print ret + print "="*80 return ret - -#old# (action,subject)= (query.action,query.subject) -#old# # use e.g. self.Get rather than self.server.Get so we use the __getattr__ code -#old# if action=='get': -#old## this makes the backend to squeak and one can't login anymore... -#old## return self.Get(subject, query.filters, query.timestamp, query.fields) -#old# return self.Get(subject, query.filters, {}, query.fields) -#old# elif action=='update': -#old# answer=self.Update(subject, query.filters, query.params, query.fields) -#old# if not isinstance (answer, ManifoldResult): print "UNEXECPECTED answer", answer -#old# return answer -#old# else: -#old# warning="WARNING: ManifoldAPI.send_manifold_query: %s not implemented for now"%action -#old# print warning -#old# print 3 -#old# return ManifoldResult(code=ManifoldCode.NOT_IMPLEMENTED, output=warning)