mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 11:12:47 +01:00
Made an empty stings cancel out of the plugin selection.
This commit is contained in:
parent
b63fc24865
commit
53f9c0aa94
@ -430,7 +430,8 @@ def main():
|
||||
# until we get example strings again, this will default to false
|
||||
#showUsage =yn('Would you like the option of seeing usage examples?')
|
||||
showUsage = False
|
||||
name = expect('What plugin would you like to look at?', plugins)
|
||||
name = expect('What plugin would you like to look at?',
|
||||
plugins, acceptEmpty=True)
|
||||
while name:
|
||||
module = loadPlugin(name)
|
||||
if module is not None:
|
||||
|
@ -49,7 +49,8 @@ def output(s, unformatted=True):
|
||||
print
|
||||
|
||||
# doindent is used in yn().
|
||||
def expect(prompt, possibilities, recursed=False, doindent=True, default=None):
|
||||
def expect(prompt, possibilities, recursed=False,
|
||||
doindent=True, default=None, acceptEmpty=False):
|
||||
"""Prompt the user with prompt, allow them to choose from possibilities.
|
||||
|
||||
If possibilities is empty, allow anything.
|
||||
@ -82,6 +83,8 @@ def expect(prompt, possibilities, recursed=False, doindent=True, default=None):
|
||||
return s
|
||||
elif not s and default is not None:
|
||||
return default
|
||||
elif not s and acceptEmpty:
|
||||
return s
|
||||
else:
|
||||
return expect(originalPrompt, possibilities, recursed=True,
|
||||
doindent=doindent, default=default)
|
||||
|
Loading…
Reference in New Issue
Block a user