Type: Class
(obsolete) UI is an abstract class that defines a set of standard interactions between a process and the user. It is implemented by Console, Toolkit Form...Sources of inspiration: logging, wxLog classes overview,...
The following methods are usually modal. They require user interaction.
- critical() (aka fatal()) - stop the application
- message() - a normal message to be acknowledged by the user
- confirm() - ask a Yes/No question. Return True if user chose Yes.
- decide() - ask a decision with multiple choices. Return index of chosen item.
Non-waiting or logging messages to the user. The following never stop program flow, and depending on configuration they will log a message to somewhere. They are as except status() and warning()
- error() - usually displayed on stderr and logged somewhere
- status() - volatile message to be displayed in the status bar. A status message is meant to inform the user about what is going on for the moment. If there is no status bar, this is forwarded to verbose().
- warning() -
display a message
warning() means that something went wrong,
or at least is not okay (though there is no reason to call it error()).
Maybe a maintainer or system administrator should examine this case.
That's why warning() messages may
be logged to a special file or sent via email.
The console suppresses this if verbosity is «quiet».
- notice() - display a normal but important message, e.g. something has been done. The console suppresses this if verbosity is «quiet».
- info() : an informational message. The console show this only if user asked to be verbose (if verbosity is «high»).
- debug() - only visible if user asked to be «very verbose»
Other ui methods:
- job() : start a new ref MSX:121 Job]
- form() : start a new ref MSX:109 Form]
- textprinter()
- report()
Refering articles:
- Job.done() without message (22.05.05) — If Job.done() is called without a message, there will no longer be a notice with the default message "Success", but no notice at all. Terminating a Job without message just means that the Job has nothing special to say, it just did it's work and that's all. UI.onJobDone() must now support the case of a None message.
- jobs now interruptible (feature 18.04.05) — A Job on the Console reacts now to Escape. At least on a Windows console (if msvcrt is available). The UI may now subclass Job. So Task can no longer be a subclass of Job. But it contains a Job instance. more
- use standard Python logging module? (code changes 10.03.05) — Should I use the standard logging module? Still thinking about relationship between Console, UI, Form etc. more
- message(), warning(), job() & Co (code changes 26.02.05) — Now it was time to start documenting the UI class. Renamed progress() to job() or startJob(), warning() to message(), message() to warning(), vmsg() to info().
- lots of changes (code changes 26.02.05) — Converted sync into a Task. UI: New method verbose() is what info() was before. Method info() now as warning(). Changed info() calls to verbose() calls.