Introduce new plugin system.

The new system is backward compatible and will load older style plugins.

The new plugin framework allows plugins to track their dependencies, and
will auto-enable plugins as needed.

Dependencies are tracked via a class-level set named `dependencies` in
each plugin.

Plugin names are no longer tightly coupled with the plugin class name,
Pso EP8 style class names may be used.

Disabling plugins is now allowed, but ensuring proper cleanup is left to
the plugin implementation.

The use of a `post_init()` method is no longer needed for new style
plugins, but plugins following the old style will still require a
`post_init()` method.
This commit is contained in:
Lance Stout
2012-03-11 18:09:45 -07:00
parent 9f43d31bf5
commit 01b2499915
3 changed files with 265 additions and 114 deletions

View File

@@ -6,6 +6,9 @@
See the file LICENSE for copying permission.
"""
from sleekxmpp.plugins.base import PluginManager, PluginNotFound, \
BasePlugin, register_plugin
__all__ = [
# Non-standard
'gmail_notify', # Gmail searching and notifications