diff options
author | hut <hut@lavabit.com> | 2013-01-10 03:58:19 +0100 |
---|---|---|
committer | hut <hut@lavabit.com> | 2013-01-10 03:58:19 +0100 |
commit | 5fe2923748e32e4d8d17d93d98987152c6adbff4 (patch) | |
tree | 576f489c7f129ef271ef3b27b5c063c4e614ad27 | |
parent | abb9e4e9e8315c0a47c8337a3b3105acce4842ff (diff) | |
download | ranger-5fe2923748e32e4d8d17d93d98987152c6adbff4.tar.gz |
widgets.console: more documentation
-rw-r--r-- | ranger/gui/widgets/console.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ranger/gui/widgets/console.py b/ranger/gui/widgets/console.py index da7e346d..b20224e1 100644 --- a/ranger/gui/widgets/console.py +++ b/ranger/gui/widgets/console.py @@ -414,4 +414,17 @@ class Console(Widget): self.execute(cmd) def ask(self, text, callback, choices=['y', 'n']): + """ + Open a question prompt with predefined choices + + The "text" is displayed as the question text and should include a list + of possible keys that the user can type. The "callback" is a function + that is called when the question is answered. It only gets the answer + as an argument. "choices" is a tuple of one-letter strings that can be + typed in by the user. Every other input gets ignored, except <Enter> + and <ESC>. + + The first choice is used when the user presses <Enter>, the second + choice is used when the user presses <ESC>. + """ self.question_queue.append((text, callback, choices)) |