[weboob] Configuration management

Romain Bignon romain at peerfuse.org
Wed Mar 31 17:32:35 CEST 2010


Hi,

A big troll is about the config management in weboob.  So the last proposal
about this was to have two configuration side.

I. The backends configuration
=============================

Regardless of frontends, user might set a list of backends *instances* in a
dedicated file. User might firstly, before using any frontend, set every
accounts he has on every backend types.

For example:

        [dlfp1]
        _type = dlfp
        login = romain
        password = blabla

        [dlfp2]
        _type = dlfp
        login = moules
        password = blablalba

        [reddit]
        _type = reddit
        login = pkk
        password = bla
        othersetting = othervalue

Etc.

II. The frontends configuration
===============================

Each frontend have to manage his configuration itself. It has the aibility to
load backends in several ways:

1. Load every configured backends
---------------------------------

A frontend can load every configured backend which implement a specific
capability:

        weboob.load_modules(caps=ICapMessages)

2. Load a list of configured backends
-------------------------------------

A frontend can also give a list of configured backends names:

        weboob.load_modules(names=('dlfp1', 'reddit'))

For example, to determine this list, the frontend can at the first launch get
the list of configured backends:

        backends = weboob.get_backends_config(caps=ICapMessages)

Then, ask user to select which backends he wants to use with this frontend, and
store this list in his own frontend configuration.

3. Load a list of static backends
---------------------------------

Some frontends don't care about the configured backends. For example, travel
depends on backends with no configuration to get static data.

As it would be annoying to add 'transilien', 'canaltp', etc, in the
'~/.weboob/backendrc' configuration file, a solution *would* be to add others
methods to Weboob:

       # Get list of available modules with this specific capability
       backends = weboob.get_modules(caps=ICapTravel)

       # Here, load static modules by names (works also with caps)
       weboob.load_static_modules(names=('transilien', 'canaltp'))

So, when the user runs 'travel' for the first time, it asks him what backends he
want to use. Then, all the time it load only selected backends (because, for
example, user doesn't care about USA's transport website).

III. Conclusion
===============

I don't know if I forget something, this is just a *proposal*, so you can
comment it.

Regards,

Romain
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: not available
URL: <http://lists.symlink.me/pipermail/weboob/attachments/20100331/ed4eb751/attachment.pgp>


More information about the Weboob mailing list