updater now has the logic to turn itself off and back on (although for now only in...
[myslice.git] / manifold / manifoldresult.py
index fcda3ad..1c812f0 100644 (file)
@@ -6,7 +6,7 @@ ManifoldCode = enum (
     SUCCESS=0,
     SESSION_EXPIRED=1,
     NOT_IMPLEMENTED=2,
-    OTHERS=3,
+    UNKNOWN_ERROR=3,
 )
 
 # being a dict this can be used with json.dumps
@@ -29,3 +29,14 @@ class ManifoldResult (dict):
     def error (self):
         return "code=%s -- %s"%(self['code'],self['output'])
     
+
+    def __repr__ (self):
+        result="[[MFresult code=%s"%self['code']
+        if self['code']==0:
+            value=self['value']
+            if isinstance(value,list): result += " [value=list with %d elts]"%len(value)
+            else: result += " [value=other %s]"%value
+        else:
+            result += " [output=%s]"%self['output']
+        result += "]]"
+        return result