X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=manifold%2Fmanifoldresult.py;h=1c812f0cb58009f098073ec0dba927b79522b760;hb=69867d5296684463d3aad4f6db867d24005102aa;hp=fcda3adc558836f05fba77bc46c7e49b6ed83b2e;hpb=c234f555055c2b891f20970b5af38187d2116f87;p=myslice.git diff --git a/manifold/manifoldresult.py b/manifold/manifoldresult.py index fcda3adc..1c812f0c 100644 --- a/manifold/manifoldresult.py +++ b/manifold/manifoldresult.py @@ -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