woob.core.backendscfg

class BackendsConfig(confpath)[source]

Bases: object

Config of backends.

A backend is an instance of a module with a config. A module can therefore have multiple backend instances.

Parameters:

confpath (str) – path to the backends config file

exception WrongPermissions[source]

Bases: Exception

Unable to write in the backends config file.

iter_backends()[source]

Iter on all saved backends.

An item is a tuple with backend name, module name, and params dict.

Return type:

Iterator[Tuple[str, str, DictWithCommands]]

backend_exists(name)[source]

Return True if the backend exists in config.

Return type:

bool

add_backend(backend_name, module_name, params)[source]

Add a backend to config.

Parameters:
  • backend_name (str) – name of the backend in config

  • module_name (str) – name of woob module

  • params (dict) – params of the backend

edit_backend(backend_name, params)[source]

Edit a backend in config.

Parameters:
  • backend_name (str) – name of the backend in config

  • params (dict) – params to change

get_backend(backend_name)[source]

Get options of backend.

Returns:

a tuple with the module name and the backends params

Return type:

tuple[str, dict]

remove_backend(backend_name)[source]

Remove a backend from config.

Returns False if the backend does not exist.

Return type:

bool

exception BackendAlreadyExists[source]

Bases: Exception

Try to add a backend that already exists.