format tooltip

This commit is contained in:
gen2brain 2013-04-06 11:17:29 +02:00
parent 365268c52d
commit e8546b4a76

View file

@ -58,6 +58,16 @@ def sl(mot):
((mot & 0x00FF0000) >> 8) |\
((mot & 0xFF000000) >> 24)
def format_tooltip(tooltip):
if len(tooltip) > 80:
lines = tooltip.split(". ")
tooltip = ""
for line in lines:
tooltip += "%s. " % line.lstrip()
if len(line) > 40:
tooltip += "\n"
return tooltip
def format_label(label):
words = label.split("_")
if len(words) > 1: