diff options
author | Lance Stout <lancestout@gmail.com> | 2011-08-06 00:41:14 -0700 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2011-08-06 00:41:14 -0700 |
commit | 5be5b8c02bea7cef40046ec29c513e669399633a (patch) | |
tree | 001f8be18cf2404a1775cbbb28b412ee7b5fe20a /sleekxmpp/basexmpp.py | |
parent | 6c4cb2bf00a047dbf5bf9f865c52f7c9703b24ae (diff) | |
download | slixmpp-5be5b8c02bea7cef40046ec29c513e669399633a.tar.gz slixmpp-5be5b8c02bea7cef40046ec29c513e669399633a.tar.bz2 slixmpp-5be5b8c02bea7cef40046ec29c513e669399633a.tar.xz slixmpp-5be5b8c02bea7cef40046ec29c513e669399633a.zip |
If no config for a plugin is given, try using self.plugin_config.
Sleek loads a few plugins by default, which made it difficult to
configure or even disable them.
Now, if a plugin is registered without any configuration, then
sleek will try finding a configuration in self.plugin_config.
Diffstat (limited to 'sleekxmpp/basexmpp.py')
-rw-r--r-- | sleekxmpp/basexmpp.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sleekxmpp/basexmpp.py b/sleekxmpp/basexmpp.py index 4d9a8964..816f2fcc 100644 --- a/sleekxmpp/basexmpp.py +++ b/sleekxmpp/basexmpp.py @@ -198,6 +198,10 @@ class BaseXMPP(XMLStream): # the sleekxmpp package, so leave out the globals(). module = __import__(module, fromlist=[plugin]) + # Use the global plugin config cache, if applicable + if not pconfig: + pconfig = self.plugin_config.get(plugin, {}) + # Load the plugin class from the module. self.plugin[plugin] = getattr(module, plugin)(self, pconfig) |