Reference for flexx.dialite¶
Dialite introduction¶
Dialite is a pure Python package to show dialogs. It is lightweight, cross-platform, and has no dependencies. It provides a handful of functions, each a verb, that can be used to inform(), warn() or fail() the user, or to ask_ok(), ask_retry() or ask_yesno().
Dialite can show dialogs on Window, OS X and Linux, and falls back to a terminal interface if dialogs are unavailable (e.g. if not supported by the platform, or for SSH connections).
On Windows, it uses Windows Script Host (cscript.exe). On OS X it uses osascript to show a dialog from the frontmost application. On Linux it uses Zenity.
Dialite API¶
-
flexx.dialite.
inform
(title='Info', message='')¶ Inform the user about something.
パラメータ: - title (str) – the text to show as the window title.
- message (str) – the message to show in the body of the dialog.
-
flexx.dialite.
warn
(title='Warning', message='')¶ Warn the user about something.
パラメータ: - title (str) – the text to show as the window title.
- message (str) – the message to show in the body of the dialog.
-
flexx.dialite.
fail
(title='Error', message='')¶ Show a message to let the user know that something failed.
パラメータ: - title (str) – the text to show as the window title.
- message (str) – the message to show in the body of the dialog.
-
flexx.dialite.
ask_ok
(title='Confirm', message='')¶ Ask the user to confirm something via an ok-cancel question.
パラメータ: - title (str) – the text to show as the window title.
- message (str) – the message to show in the body of the dialog.
戻り値: result – Whether the user selected “OK”.
戻り値の型: bool
-
flexx.dialite.
ask_retry
(title='Retry', message='')¶ Ask the user whether to retry something via a retry-cancel question.
パラメータ: - title (str) – the text to show as the window title.
- message (str) – the message to show in the body of the dialog.
戻り値: result – Whether the user selected “Retry”.
戻り値の型: bool
-
flexx.dialite.
ask_yesno
(title='Question', message='')¶ Ask the user a yes-no question.
パラメータ: - title (str) – the text to show as the window title.
- message (str) – the message to show in the body of the dialog.
戻り値: result – Whether the user selected “Yes”.
戻り値の型: bool