work on balloon

This commit is contained in:
Mattias Andrée 2012-08-20 00:28:01 +02:00
parent 7f1e5535b3
commit b36f6d5527

View file

@ -950,14 +950,20 @@ class Backend():
if self.wrapcolumn is not None:
wrap = self.wrapcolumn - left
w = 6
h = 5
lines = self.message.split('\n')
h = 4 + len(lines)
w = 6 + len(max(lines, key = len))
if w < width: w = width
if h < height: h = height
rc = (('X' * w) + '\n') * h
rc = '/' + '-' * (w - 2) + '\\\n'
rc += '|' + ' ' * (w - 2) + '|\n'
for line in lines:
rc += '| ' + line + ' ' * (w - len(line) - 6) + ' |\n'
rc += '|' + ' ' * (w - 2) + '|\n'
rc += '\\' + '-' * (w - 2) + '/'
return rc[:-1]
return rc