mirror of
https://github.com/erkin/ponysay.git
synced 2025-02-07 13:36:43 +01:00
work on balloon
This commit is contained in:
parent
7f1e5535b3
commit
b36f6d5527
1 changed files with 10 additions and 4 deletions
14
ponysay.py
14
ponysay.py
|
@ -950,14 +950,20 @@ class Backend():
|
||||||
if self.wrapcolumn is not None:
|
if self.wrapcolumn is not None:
|
||||||
wrap = self.wrapcolumn - left
|
wrap = self.wrapcolumn - left
|
||||||
|
|
||||||
w = 6
|
lines = self.message.split('\n')
|
||||||
h = 5
|
h = 4 + len(lines)
|
||||||
|
w = 6 + len(max(lines, key = len))
|
||||||
if w < width: w = width
|
if w < width: w = width
|
||||||
if h < height: h = height
|
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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue