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'
login_cb(backend_name, value)[source]
unload_backends(*args, **kwargs)[source]
is_module_loadable(info)[source]
load_backends(*args, **kwargs)[source]
check_loaded_backends(default_config=None)[source]
prompt_create_backends(default_config=None)[source]
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()
do(function, *args, **kwargs)[source]
parse_id(_id, unique_backend=False)[source]
register_backend(name, ask_add=True)[source]
install_module(name)[source]
edit_backend(name, params=None)[source]
add_backend(module_name, backend_name, params=None, edit=False, ask_register=True)[source]
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)

print(txt)[source]
acquire_input(content=None, editor_params=None)[source]
bcall_error_handler(backend, error, backtrace)[source]

Handler for an exception inside the CallErrors exception.

This method can be overridden to support more exceptions types.

bcall_errors_handler(errors, debugmsg='Use --debug option to print backtraces', ignore=())[source]

Handler for the CallErrors exception.

exception BackendNotGiven(id, backends)[source]

Bases: Exception