mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-20 00:54:45 +01:00
Let's not bold the options in expect()
This commit is contained in:
parent
86efb09d6e
commit
3e1be1858b
@ -58,17 +58,21 @@ def expect(prompt, possibilities, recursed=False, default=None,
|
||||
originalPrompt = prompt
|
||||
if recursed:
|
||||
output('Sorry, that response was not an option.')
|
||||
if useBold:
|
||||
choices = '[%s%%s%s]' % (ansi.RESET, ansi.BOLD)
|
||||
else:
|
||||
choices = '[%s]'
|
||||
if possibilities:
|
||||
prompt = '%s [%s]' % (originalPrompt, '/'.join(possibilities))
|
||||
prompt = '%s %s' % (originalPrompt, choices % '/'.join(possibilities))
|
||||
if len(prompt) > 70:
|
||||
prompt = '%s [%s]' % (originalPrompt, '/ '.join(possibilities))
|
||||
prompt = '%s %s' % (originalPrompt, choices % '/ '.join(possibilities))
|
||||
if default is not None:
|
||||
prompt = '%s (default: %s)' % (prompt, default)
|
||||
prompt = textwrap.fill(prompt)
|
||||
prompt = prompt.replace('/ ', '/')
|
||||
prompt = prompt.strip() + ' '
|
||||
if useBold:
|
||||
sys.stdout.write(ansi.BOLD)
|
||||
print ansi.BOLD,
|
||||
s = raw_input(prompt)
|
||||
if useBold:
|
||||
print ansi.RESET
|
||||
|
Loading…
Reference in New Issue
Block a user