lp:~zyga/lava-core/plugin-loader-respin
- Get this branch:
- bzr branch lp:~zyga/lava-core/plugin-loader-respin
Branch merges
- Michael Hudson-Doyle (community): Approve
-
Diff: 455 lines (+441/-0)3 files modifiedlava/core/errors.py (+38/-0)
lava/core/plugins.py (+131/-0)
lava/core/tests/test_plugins.py (+272/-0)
Branch information
Recent revisions
- 10. By Zygmunt Krynicki
-
Make PluginLoader retain the order of entries from pkg_resources
Previously calling PluginLoader methods would trigger one-time initialization
via pkg_resources.iter_entry_ points( ). This method retains some of the ordering
of the declarations in setup.py files which can be useful, for example, for
listing commands in the expected order. This order was lost when entry points
were cached in a plain dictionary. This patch replaces all relevant uses of
plain dictionaries with OrderedDict (from the simplejson module) - 9. By Zygmunt Krynicki
-
Add plugins and errors modules
The PluginLoader class is a simple thin wrapper around pkg_resources entry
points. It de-couples LAVA from grotty pkg_resources details and allows us to
migrate away from that technology later. It also allows us to explore frozen
applications that would allow lava to run on windows.The PluginLoader class has basically two methods: to load all plugins that
"reside" in a particular namespace and to load an explicitly named plugin (also
from a particular namespace). Namespace names are translated 1-to-1 to
pkg_resources namespaces but are sufficiently abstract that this is not
important. All plugins must explicitly inherit from a base class designated by
the caller. In lava-core this is typically an interface that has all the
expected methods and properties that the calling side will later expect from
the returned object.The errors module starts with two related exception classes. In subsequent
patches it will be used as a bag of assorted exceptions used in all of
lava-core. - 7. By Zygmunt Krynicki
-
Add stub Environment class
Environment is a json-document Document that wraps the entire lava
configuration. Subsequent patches will add more functionality, as needed by
other parts of core. Note: this environment will eventually replace
settings.conf from lava-server. - 6. By Zygmunt Krynicki
-
Add project support files
This is the basic set of files: setup.py, MANIFEST.in, some text files, and the
basic package structure. I've left out HACKING as I want to do some editiong on
the contents.
Branch metadata
- Branch format:
- Branch format 7
- Repository format:
- Bazaar repository format 2a (needs bzr 1.16 or later)
- Stacked on:
- lp:lava-core