+ elif isinstance (result,dict):
+ print "result is a dict with %d keys : %s"%(len(result),result.keys())
+ for (k,v) in result.iteritems():
+ if v is None: continue
+ if k=='value': self._print_value(v)
+ else: print '+++',k,':',mytruncate (v,30)
+ else: print "[dont know how to display result] %s"%result
+
+ # how to display a call
+ def _repr_query (self,methodName, query):
+ try: action=query['action']
+ except: action="???"
+ try: subject=query['object']
+ except: subject="???"
+ # most of the time, we run 'forward'
+ if methodName=='forward': return "forward(%s(%s))"%(action,subject)
+ else: return "%s(%s)"%(action,subject)