summaryrefslogtreecommitdiff
path: root/sleekxmpp/basexmpp.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2010-10-17 15:47:24 -0400
committerLance Stout <lancestout@gmail.com>2010-10-17 15:47:24 -0400
commitfaec86b3be38756510fb3534c7615db75ecd53b7 (patch)
tree9b5ebb13d9a3cf6fb31dda23c47fc7b8e83aaa86 /sleekxmpp/basexmpp.py
parent505a63da3a4cdcd1a38fc18f41a6988d792dda8b (diff)
downloadslixmpp-faec86b3be38756510fb3534c7615db75ecd53b7.tar.gz
slixmpp-faec86b3be38756510fb3534c7615db75ecd53b7.tar.bz2
slixmpp-faec86b3be38756510fb3534c7615db75ecd53b7.tar.xz
slixmpp-faec86b3be38756510fb3534c7615db75ecd53b7.zip
Import plugins from string referenced modules.
Diffstat (limited to 'sleekxmpp/basexmpp.py')
-rw-r--r--sleekxmpp/basexmpp.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/sleekxmpp/basexmpp.py b/sleekxmpp/basexmpp.py
index 78ecec33..3db29a9a 100644
--- a/sleekxmpp/basexmpp.py
+++ b/sleekxmpp/basexmpp.py
@@ -176,6 +176,10 @@ class BaseXMPP(XMLStream):
module = sleekxmpp.plugins
module = __import__("%s.%s" % (module.__name__, plugin),
globals(), locals(), [plugin])
+ if isinstance(module, str):
+ # We probably want to load a module from outside
+ # the sleekxmpp package, so leave out the globals().
+ module = __import__(module, fromlist=[plugin])
# Load the plugin class from the module.
self.plugin[plugin] = getattr(module, plugin)(self, pconfig)