forked from M-Labs/artiq
gui/short_format: show string values
This commit is contained in:
parent
05dd11a60d
commit
61f45f505b
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue