aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-05-13 08:06:35 +0200
committerMattias Andrée <maandree@operamail.com>2013-05-13 08:06:35 +0200
commitebba333bdb4db2f0ff05a21e7a85a2c3c9c5b34b (patch)
treeee71a176576c666c82479cf67cfe43a6f723b82d
parentadd parsing (diff)
downloadsplashtool-ebba333bdb4db2f0ff05a21e7a85a2c3c9c5b34b.tar.gz
splashtool-ebba333bdb4db2f0ff05a21e7a85a2c3c9c5b34b.tar.bz2
splashtool-ebba333bdb4db2f0ff05a21e7a85a2c3c9c5b34b.tar.xz
output fix
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rwxr-xr-xsrc/parse.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/parse.py b/src/parse.py
index 52af7de..698bde9 100755
--- a/src/parse.py
+++ b/src/parse.py
@@ -123,15 +123,16 @@ title = '\033' + colour_title + '\033' + title + '\033\033'
helpmsgendrow -= vshift
helptext = (helptext + '\n' * (helpmsgendrow - helpmsgrow)).split('\n')[: helpmsgendrow - helpmsgrow + 1]
-helptext = ['\033' + colour_help + '\033' + (x + ' ' * 86)[:86] + '\033\033' for x in helptext]
+helptext = ['\033' + colour_help + '\033' + (' ' * margin + x + ' ' * 86)[:86] + '\033\033' for x in helptext]
helptext = '\n'.join(helptext)
-text = '\n' * vshift + ' ' * margin + '\033' + border + '\033┌' + '─' * width + '┐\033\033\n'
-text += ' ' * margin + '\033' + border + '\033│\033\033' + title + '\033' + border + '\033│\033\033\n'
-text += ' ' * margin + '\033' + border + '\033├' + '─' * width + '┤\033\033\n'
+menumargin = (86 - width) // 2
+text = '\n' * vshift + ' ' * menumargin + '\033' + border + '\033┌' + '─' * width + '┐\033\033\n'
+text += ' ' * menumargin + '\033' + border + '\033│\033\033' + title + '\033' + border + '\033│\033\033\n'
+text += ' ' * menumargin + '\033' + border + '\033├' + '─' * width + '┤\033\033\n'
for label in labels:
- text += ' ' * margin + '\033' + border + '\033│\033\033' + label + '\033' + border + '\033│\033\033\n'
-text += ' ' * margin + '\033' + border + '\033└' + '─' * width + '┘\033\033\n'
+ text += ' ' * menumargin + '\033' + border + '\033│\033\033' + label + '\033' + border + '\033│\033\033\n'
+text += ' ' * menumargin + '\033' + border + '\033└' + '─' * width + '┘\033\033\n'
more = []