summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/base.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-06-19 21:50:33 -0700
committerLance Stout <lancestout@gmail.com>2012-06-19 21:50:33 -0700
commit5820d49cd401a1362a8a675c4b91935adb1240fe (patch)
treef40f78839ae3004bfb0b8da1ae93d61759d8ad66 /sleekxmpp/plugins/base.py
parent1ab66e576786ecb0cfb9b6b163811735564b951b (diff)
parent36c11ad9de7c1b5a199aa5a4302e33085513c126 (diff)
downloadslixmpp-5820d49cd401a1362a8a675c4b91935adb1240fe.tar.gz
slixmpp-5820d49cd401a1362a8a675c4b91935adb1240fe.tar.bz2
slixmpp-5820d49cd401a1362a8a675c4b91935adb1240fe.tar.xz
slixmpp-5820d49cd401a1362a8a675c4b91935adb1240fe.zip
Merge branch 'master' into develop
Conflicts: sleekxmpp/basexmpp.py
Diffstat (limited to 'sleekxmpp/plugins/base.py')
-rw-r--r--sleekxmpp/plugins/base.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/sleekxmpp/plugins/base.py b/sleekxmpp/plugins/base.py
index 9a7e1b19..337db2db 100644
--- a/sleekxmpp/plugins/base.py
+++ b/sleekxmpp/plugins/base.py
@@ -31,10 +31,10 @@ log = logging.getLogger(__name__)
PLUGIN_REGISTRY = {}
#: In order to do cascading plugin disabling, reverse dependencies
-#: must be tracked.
+#: must be tracked.
PLUGIN_DEPENDENTS = {}
-#: Only allow one thread to manipulate the plugin registry at a time.
+#: Only allow one thread to manipulate the plugin registry at a time.
REGISTRY_LOCK = threading.RLock()
@@ -75,7 +75,7 @@ def load_plugin(name, module=None):
plugins are in packages matching their name,
even though the plugin class name does not
have to match.
- :param str module: The name of the base module to search
+ :param str module: The name of the base module to search
for the plugin.
"""
try:
@@ -84,7 +84,7 @@ def load_plugin(name, module=None):
module = 'sleekxmpp.plugins.%s' % name
__import__(module)
mod = sys.modules[module]
- except:
+ except ImportError:
module = 'sleekxmpp.features.%s' % name
__import__(module)
mod = sys.modules[module]
@@ -103,11 +103,11 @@ def load_plugin(name, module=None):
# we can work around dependency issues.
plugin.old_style = True
register_plugin(plugin, name)
- except:
+ except ImportError:
log.exception("Unable to load plugin: %s", name)
-class PluginManager(object):
+class PluginManager(object):
def __init__(self, xmpp, config=None):
#: We will track all enabled plugins in a set so that we
#: can enable plugins in batches and pull in dependencies
@@ -181,7 +181,7 @@ class PluginManager(object):
def enable_all(self, names=None, config=None):
"""Enable all registered plugins.
-
+
:param list names: A list of plugin names to enable. If
none are provided, all registered plugins
will be enabled.
@@ -292,7 +292,7 @@ class BasePlugin(object):
def post_init(self):
"""Initialize any cross-plugin state.
-
+
Only needed if the plugin has circular dependencies.
"""
pass