gui/short_format: show string values

This commit is contained in:
Sebastien Bourdeauducq 2015-07-25 14:37:19 +08:00
parent 05dd11a60d
commit 61f45f505b
1 changed files with 5 additions and 0 deletions

View File

@ -13,6 +13,11 @@ def short_format(v):
t = type(v) t = type(v)
if t is int or t is float: if t is int or t is float:
return str(v) return str(v)
elif t is str:
if len(v) < 15:
return "\"" + v + "\""
else:
return "\"" + v[:12] + "\"..."
else: else:
r = t.__name__ r = t.__name__
if t is list or t is dict or t is set: if t is list or t is dict or t is set: