b.u.t.TextUIFactory(UIFactory) : class documentation

Part of bzrlib.ui.text View In Hierarchy

Known subclasses: bzrlib.tests.TestUIFactory

A UI factory for Text user interefaces.
Method __init__ Create a TextUIFactory.
Method choose Prompt the user for a list of alternatives.
Method be_quiet Tell the UI to be more quiet, or not.
Method clear_term Prepare the terminal for output.
Method get_integer Get an integer from the user.
Method get_non_echoed_password Undocumented
Method get_password Prompt the user for a password.
Method get_username Prompt the user for a username.
Method make_progress_view Construct and return a new ProgressView subclass for this UI.
Method note Write an already-formatted message, clearing the progress bar if necessary.
Method prompt Emit prompt on the CLI.
Method report_transport_activity Called by transports as they do IO.
Method log_transport_activity See UIFactory.log_transport_activity()
Method show_error Show an error message (not an exception) to the user.
Method show_message Show a message to the user.
Method show_warning Show a warning to the user.
Method show_user_warning Show a text message to the user.
Method _make_output_stream_explicit Undocumented
Method _progress_updated A task has been updated and wants to be displayed.
Method _progress_all_finished Called when the top-level progress task finished

Inherited from UIFactory:

Method __enter__ Context manager entry support.
Method __exit__ Context manager exit support.
Method confirm_action Seek user confirmation for an action.
Method is_quiet Undocumented
Method make_output_stream Get a stream for sending out bulk text data.
Method nested_progress_bar Return a nested progress bar.
Method format_user_warning Undocumented
Method get_boolean Get a boolean question answered from the user.
Method recommend_upgrade Recommend the user upgrade a control directory.
Method _progress_finished Called by the ProgressTask when it finishes
def __init__(self, stdin=None, stdout=None, stderr=None):
Create a TextUIFactory.
def choose(self, msg, choices, default=None):
Prompt the user for a list of alternatives.

        Support both line-based and char-based editing.

        In line-based mode, both the shortcut and full choice name are valid
        answers, e.g. for choose('prompt', '&yes
&no'): 'y', ' Y ', ' yes',
        'YES ' are all valid input lines for choosing 'yes'.

        An empty line, when in line-based mode, or pressing enter in char-based
        mode will select the default choice (if any).

        Choice is echoed back if:
        - input is char-based; which means a controlling terminal is available,
          and osutils.getchar is used
        - input is line-based, and no controlling terminal is available
        
def be_quiet(self, state):
Tell the UI to be more quiet, or not.

Typically this suppresses progress bars; the application may also look at ui_factory.is_quiet().

def clear_term(self):
Prepare the terminal for output.

This will, clear any progress bars, and leave the cursor at the leftmost position.

def get_integer(self, prompt):
Get an integer from the user.
Parametersprompta message to prompt the user with. Could be a multi-line prompt but without a terminating n.
ReturnsA signed integer.
def get_non_echoed_password(self):
Undocumented
def get_password(self, prompt=u'', **kwargs):
Prompt the user for a password.
ParameterspromptThe prompt to present the user
kwargsArguments which will be expanded into the prompt. This lets front ends display different things if they so choose.
ReturnsThe password string, return None if the user canceled the request.
def get_username(self, prompt, **kwargs):
Prompt the user for a username.
ParameterspromptThe prompt to present the user
kwargsArguments which will be expanded into the prompt. This lets front ends display different things if they so choose.
ReturnsThe username string, return None if the user canceled the request.
def make_progress_view(self):
Construct and return a new ProgressView subclass for this UI.
def _make_output_stream_explicit(self, encoding, encoding_type):
Undocumented
def note(self, msg):
Write an already-formatted message, clearing the progress bar if necessary.
def prompt(self, prompt, **kwargs):
Emit prompt on the CLI.
ParameterskwargsDictionary of arguments to insert into the prompt, to allow UIs to reformat the prompt.
def report_transport_activity(self, transport, byte_count, direction):
Called by transports as they do IO.

This may update a progress bar, spinner, or similar display. By default it does nothing.

def log_transport_activity(self, display=False):
See UIFactory.log_transport_activity()
def show_error(self, msg):
Show an error message (not an exception) to the user.

The message should not have an error prefix or trailing newline. That will be added by the factory if appropriate.

def show_message(self, msg):
Show a message to the user.
def show_warning(self, msg):
Show a warning to the user.
def _progress_updated(self, task):
A task has been updated and wants to be displayed.
def _progress_all_finished(self):
Called when the top-level progress task finished
def show_user_warning(self, warning_id, **message_args):
Show a text message to the user.

Explicitly not for warnings about bzr apis, deprecations or internals.

API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.