nicer symbol for cut parts
This commit is contained in:
@ -11,7 +11,9 @@ FOOTER = '</td></tr></table></div>'
|
||||
SEP = '</td></tr><tr><td>'
|
||||
LINE = '{0}</td><td>{1}</td><td>{2}</td><td>{3}'
|
||||
|
||||
IGNORE = ["In", "Out", "exit", "quit", "get_ipython"]
|
||||
IGNORE = ("In", "Out", "exit", "quit", "get_ipython")
|
||||
|
||||
SNIP = " ...✀... "
|
||||
|
||||
RE_DIGITS = re.compile("([0-9]+)")
|
||||
|
||||
@ -105,11 +107,11 @@ def format_value(obj): #TODO: make magic numbers configurable
|
||||
# try if separate lines can be used to shorten
|
||||
splitted = res.split("\n")
|
||||
if len(splitted) > 4:
|
||||
res = splitted[0] + " ... " + splitted[-1]
|
||||
res = splitted[0] + SNIP + splitted[-1]
|
||||
# if still too long (or no lines), cut the middle part
|
||||
if len(res) < 120:
|
||||
return res
|
||||
res = res[:50] + " ... " + res[-50:]
|
||||
res = res[:50] + SNIP + res[-50:]
|
||||
return res
|
||||
|
||||
def format_type(obj):
|
||||
|
Reference in New Issue
Block a user