152
152
self._quiet = state
154
def confirm_action(self, prompt, confirmation_id, args, default=True):
154
def confirm_action(self, prompt, confirmation_id, prompt_kwargs):
155
155
"""Seek user confirmation for an action.
157
157
If the UI is noninteractive, or the user does not want to be asked
158
about this action, the default value will be returned.
158
about this action, True is returned, indicating bzr should just
160
161
The confirmation id allows the user to configure certain actions to
161
162
always be confirmed or always denied, and for UIs to specialize the
162
163
display of particular confirmations.
164
165
:param prompt: Suggested text to display to the user.
165
:param args: A dictionary of arguments that can be string-interpolated
166
:param prompt_kwargs: A dictionary of arguments that can be
167
string-interpolated into the prompt.
167
168
:param confirmation_id: Unique string identifier for the confirmation.
169
return self.get_boolean(prompt % args)
170
return self.get_boolean(prompt % prompt_kwargs)
171
172
def get_password(self, prompt='', **kwargs):
172
173
"""Prompt the user for a password.
397
398
class NoninteractiveUIFactory(UIFactory):
398
399
"""Base class for UIs with no user."""
400
def confirm_action(self, prompt, confirmation_id, args, default=True):
401
def confirm_action(self, prompt, confirmation_id, prompt_kwargs):
404
405
class SilentUIFactory(NoninteractiveUIFactory):