User Interface Implementation¶
Interface implementation.
- class dput.interface.AbstractInterface¶
Abstract base class for Concrete implementations of user interfaces.
The invoking process will instantiate the process, call initialize, query (any number of times), and shutdown.
- boolean(title, message, question_type=['yes', 'no'], default=None)¶
Display a question returning a boolean value. This is evaluated by checking the button return code either to be BUTTON_YES or BUTTON_OK
- abstract initialize(**kwargs)¶
Set up the interface state.
- list(title, message, selections=[])¶
Display a list of alternatives the user can choose from, returns a list of selections.
- message(title, message, question_type='ok')¶
Display a message and a confirmation button when required by the interface to make sure the user noticed the message Some interfaces, e.g. the CLI may ignore the button.
- password(title, message)¶
Query for user input. The input is returned literally but not printed back. This is a shortcut to
dput.interface.AbstractInterface.question()
with echo_input defaulting to False
- question(title, message, echo_input=True)¶
Query for user input. The input is returned literally
- abstract shutdown()¶
Get rid of everything, close out.
- dput.interface.BUTTON_CANCEL = 'cancel'¶
A button labeled ‘ok’
- dput.interface.BUTTON_NO = 'no'¶
A button labeled ‘cancel’
- dput.interface.BUTTON_YES = 'yes'¶
A button labeled ‘no’