Some minor cleanups.

This commit is contained in:
Griatch 2014-12-17 00:50:05 +01:00
parent e48b5dd1d2
commit 192d12d905

View file

@ -489,9 +489,12 @@ def prompt_choice(caller, question="", prompts=None, choicefunc=None, force_choo
asked, followed by a serie of prompts. Note that this isn't asked, followed by a serie of prompts. Note that this isn't
making use of the menu node system. making use of the menu node system.
prompts - prompts of choices questions=
choicefunc - functions callback to be called as func(self) when make choice (self.caller is available) prompts - list of choices
The function's definision should be like func(self, menu_node), and menu_node.key is user's choice. choicefunc - functions callback to be called as func(self) when
make choice (self.caller is available) The function's definision
should be like func(self, menu_node), and menu_node.key is user's
choice.
force_choose - force user to make a choice or not force_choose - force user to make a choice or not
""" """
@ -499,7 +502,7 @@ def prompt_choice(caller, question="", prompts=None, choicefunc=None, force_choo
count = 0 count = 0
choices = "" choices = ""
commands = [] commands = []
for choice in prompts: for choice in utils.makeiter(prompts):
count += 1 count += 1
choices += "\n{lc%d{lt[%d]{le %s" % (count, count, choice) choices += "\n{lc%d{lt[%d]{le %s" % (count, count, choice)