Part of bzrlib
Abstraction for interacting with the user.
Applications can choose different types of UI, and they deal with displaying messages or progress to the user, and with gathering different types of input.
Several levels are supported, and you can also register new factories such as for a GUI.
Module | text | Text UI, write output to the console. |
From the __init__.py module:
Class | CannedInputUIFactory | A silent UI that return canned input. |
Class | ConfirmationUserInterfacePolicy | Wrapper for a UIFactory that allows or denies all confirmed actions. |
Class | NoninteractiveUIFactory | Base class for UIs with no user. |
Class | NullOutputStream | Acts like a file, but discard all output. |
Class | NullProgressView | Soak up and ignore progress information. |
Class | SilentUIFactory | A UI Factory which never prints anything. |
Class | UIFactory | UI abstraction. |
Function | bool_from_string | Returns a boolean if the string can be interpreted as such. |
Function | make_ui_for_terminal | Construct and return a suitable UIFactory for a text mode program. |
Interpret case insensitive strings as booleans. The default values includes: 'yes', 'no, 'y', 'n', 'true', 'false', '0', '1', 'on', 'off'. Alternative values can be provided with the 'accepted_values' parameter.
Parameters | s | A string that should be interpreted as a boolean. It should be of type string or unicode. |
accepted_values | An optional dict with accepted strings as keys and True/False as values. The strings will be tested against a lowered version of 's'. | |
Returns | True or False for accepted strings, None otherwise. |