Add default_label to other implementations of prompt()
This commit is contained in:
parent
cef7bc9af5
commit
4537895941
@ -114,7 +114,8 @@ class User():
|
|||||||
finally:
|
finally:
|
||||||
self.end_progress()
|
self.end_progress()
|
||||||
|
|
||||||
def prompt(self, title, message, accept_label, reject_label, parent=None):
|
def prompt(self, title, message, accept_label, reject_label, parent=None,
|
||||||
|
default_label=None):
|
||||||
"""
|
"""
|
||||||
Prompt the user with a message to select an alternative.
|
Prompt the user with a message to select an alternative.
|
||||||
|
|
||||||
@ -128,6 +129,8 @@ class User():
|
|||||||
:type accept_label: str
|
:type accept_label: str
|
||||||
:param reject_label: what to call the negative choice, e.g.: "Stop"
|
:param reject_label: what to call the negative choice, e.g.: "Stop"
|
||||||
:type reject_label: str
|
:type reject_label: str
|
||||||
|
:param default_label: the label of the default
|
||||||
|
:type default_label: str or None
|
||||||
:returns: the user's answer to the question
|
:returns: the user's answer to the question
|
||||||
:rtype: bool
|
:rtype: bool
|
||||||
"""
|
"""
|
||||||
|
@ -91,7 +91,8 @@ class User(user.User):
|
|||||||
self._progress.close()
|
self._progress.close()
|
||||||
self._progress = None
|
self._progress = None
|
||||||
|
|
||||||
def prompt(self, title, message, accept_label, reject_label, parent=None):
|
def prompt(self, title, message, accept_label, reject_label, parent=None,
|
||||||
|
default_label=None):
|
||||||
"""
|
"""
|
||||||
Prompt the user with a message to select an alternative.
|
Prompt the user with a message to select an alternative.
|
||||||
|
|
||||||
@ -105,6 +106,8 @@ class User(user.User):
|
|||||||
:param accept_label: what to call the positive choice, e.g.: "Proceed"
|
:param accept_label: what to call the positive choice, e.g.: "Proceed"
|
||||||
:type accept_label: str
|
:type accept_label: str
|
||||||
:param reject_label: what to call the negative choice, e.g.: "Stop"
|
:param reject_label: what to call the negative choice, e.g.: "Stop"
|
||||||
|
:param default_label: the label of the default
|
||||||
|
:type default_label: str or None
|
||||||
:type reject_label: str
|
:type reject_label: str
|
||||||
:returns: the user's answer to the question
|
:returns: the user's answer to the question
|
||||||
:rtype: bool
|
:rtype: bool
|
||||||
|
Loading…
Reference in New Issue
Block a user