Add default_label to other implementations of prompt()

This commit is contained in:
Doug Blank 2016-04-17 14:27:50 -04:00
parent cef7bc9af5
commit 4537895941
2 changed files with 8 additions and 2 deletions

View File

@ -114,7 +114,8 @@ class User():
finally:
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.
@ -128,6 +129,8 @@ class User():
:type accept_label: str
:param reject_label: what to call the negative choice, e.g.: "Stop"
: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
:rtype: bool
"""

View File

@ -91,7 +91,8 @@ class User(user.User):
self._progress.close()
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.
@ -105,6 +106,8 @@ class User(user.User):
:param accept_label: what to call the positive choice, e.g.: "Proceed"
:type accept_label: str
: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
:returns: the user's answer to the question
:rtype: bool