From 5fe2923748e32e4d8d17d93d98987152c6adbff4 Mon Sep 17 00:00:00 2001 From: hut Date: Thu, 10 Jan 2013 03:58:19 +0100 Subject: widgets.console: more documentation --- ranger/gui/widgets/console.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 + and . + + The first choice is used when the user presses , the second + choice is used when the user presses . + """ self.question_queue.append((text, callback, choices)) -- cgit 1.4.1-2-gfad0