various fixes
[myslice.git] / manifold / manifoldapi.py
index c0870ec..2548287 100644 (file)
@@ -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)