Fixes to expect, some to the way it wraps, etc.

This commit is contained in:
Jeremy Fincher 2003-09-25 07:15:10 +00:00
parent eadc1bc3d7
commit 757f1aa927
1 changed files with 5 additions and 3 deletions

View File

@ -38,9 +38,11 @@ def expect(prompt, possibilities, recursed=False):
print 'Sorry, that response was not an option.'
if possibilities:
prompt = '%s [%s]' % (originalPrompt, '/'.join(possibilities))
if len(prompt) > 70:
prompt = '%s [%s]' % (originalPrompt, '/ '.join(possibilities))
prompt = textwrap.fill(prompt, subsequent_indent=indent)
if len(prompt) > 70:
prompt = '%s [%s]' % (originalPrompt, '/ '.join(possibilities))
prompt = textwrap.fill(prompt, subsequent_indent=indent)
else:
prompt = textwrap.fill(prompt)
prompt = prompt.replace('/ ', '/')
prompt = prompt.strip() + ' '
s = raw_input(prompt)