mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 19:22:45 +01:00
Fixed extra [y/n] options in expect.
This commit is contained in:
parent
fb07813a55
commit
2e28200a41
@ -30,6 +30,7 @@
|
|||||||
###
|
###
|
||||||
|
|
||||||
def expect(prompt, possibilities, recursed=False):
|
def expect(prompt, possibilities, recursed=False):
|
||||||
|
originalPrompt = prompt
|
||||||
if recursed:
|
if recursed:
|
||||||
print 'Sorry, that response was not an option.'
|
print 'Sorry, that response was not an option.'
|
||||||
if possibilities:
|
if possibilities:
|
||||||
@ -40,7 +41,7 @@ def expect(prompt, possibilities, recursed=False):
|
|||||||
if s in possibilities:
|
if s in possibilities:
|
||||||
return s.strip()
|
return s.strip()
|
||||||
else:
|
else:
|
||||||
return expect(prompt, possibilities, recursed=True)
|
return expect(originalPrompt, possibilities, recursed=True)
|
||||||
else:
|
else:
|
||||||
return s.strip()
|
return s.strip()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user