[weboob] Configuration management
christophe.benz at gmail.com
Thu Apr 1 18:06:35 CEST 2010
I am OK with that stuff.
But you didn't talk about frontend configuration, for example the mail
frontend should store its SMTP, or the http frontend the port on which
it serves, etc.
What do you think about it?
Le Wed, 31 Mar 2010 17:32:35 +0200,
Romain Bignon <romain at peerfuse.org> a écrit :
> 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:
> _type = dlfp
> login = romain
> password = blabla
> _type = dlfp
> login = moules
> password = blablalba
> _type = reddit
> login = pkk
> password = bla
> othersetting = othervalue
> 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:
> 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.
More information about the weboob