woob.tools.application.console
¶
- class ConsoleApplication(option_parser=None)[source]¶
Bases:
Application
Base application class for CLI applications.
- CAPS = None¶
- BOLD = '\x1b[1m'¶
- NC = '\x1b[0m'¶
- load_default_backends()[source]¶
By default loads all backends.
Applications can overload this method to restrict backends loaded.
- classmethod run(args=None)[source]¶
This static method can be called to run the application.
It creates the application object, handles options, setups logging, calls the main() method, and catches common exceptions.
You can’t do anything after this call, as it always finishes with a call to sys.exit().
For example:
>>> from woob.application.myapplication import MyApplication >>> MyApplication.run()
- ask(question, default=None, masked=None, regexp=None, choices=None, tiny=None)[source]¶
Ask a question to user.
@param question text displayed (str) @param default optional default value (str) @param masked if True, do not show typed text (bool) @param regexp text must match this regexp (str) @param choices choices to do (list) @param tiny ask for the (small) value of the choice (bool) @return entered text by user (str)