text: force shorten to return unicode string

This commit is contained in:
Mathieu Virbel 2012-08-07 07:50:46 +02:00
parent 37c2a39928
commit ed4218047c
1 changed files with 2 additions and 2 deletions

View File

@ -208,11 +208,11 @@ class LabelBase(object):
if segment - margin > 5:
segment -= margin
return '{0}...{1}'.format(text[:segment].strip(),
return u'{0}...{1}'.format(text[:segment].strip(),
text[-segment:].strip())
else:
segment = max_letters - 3 # length of '...'
return '{0}...'.format(text[:segment].strip())
return u'{0}...'.format(text[:segment].strip())
def render(self, real=False):
'''Return a tuple(width, height) to create the image