Skip to content

Introduce modules loaders and reorganize Woob* classes

Romain Bignon requested to merge rbignon/woob:modules-loaders into master

Before there were two classes:

  • WoobBase, with as argument a path to woob modules, adds it in the PYTHONPATH and load them
  • Woob, which uses the woob repositories to install remote modules, and manage ~/.config/woob/backends to persist backends

It is reorganized in two new classes:

  • Woob4, which takes as a first argument a "modules loader"
  • WoobUserBackends, with the only add is to manage ~/.config/woob/backends to persist backends

So, how to install/load modules, and how you use woob as a stateless or not, is now separated.

There are four classes of modules loaders:

  • ModulesLocal, more or less the same than how WoobBase worked, but woob_modules must be in the PYTHONPATH (it doesn't add it anymore)
  • ModulesPath, the same but with a specific path for modules
  • ModulesWoobRepositories, to install and load modules from https://updates.woob.tech
  • ModulesPIP, to install and load modules from PyPI
Edited by Romain Bignon

Merge request reports