1 # yet another way to display records...
2 def beginning (foo,size=15):
4 if len(full)<=size: return full
5 return full[:size-3]+'...'
7 def printable (record_s):
9 if isinstance (record_s,list):
10 return "[" + "\n".join( [ printable(r) for r in record_s ]) + "]"
11 if isinstance (record_s, dict):
12 return "{" + " , ".join( [ "%s:%s"%(k,beginning(v)) for k,v in record_s.iteritems() ] ) + "}"
13 if isinstance (record_s, str):
15 return "unprintable [[%s]]"%record_s