SUCCESS=0,
SESSION_EXPIRED=1,
NOT_IMPLEMENTED=2,
- OTHERS=3,
+ UNKNOWN_ERROR=3,
)
# being a dict this can be used with json.dumps
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