diff options
author | Nathan Fritz <nathan@andyet.net> | 2010-05-27 01:51:51 +0800 |
---|---|---|
committer | Thom Nichols <tmnichols@gmail.com> | 2010-06-01 22:07:51 +0800 |
commit | a2719b0bb0d4ac26f30c462e6eebb32965637d34 (patch) | |
tree | efff1e464a619bb95b693c615b0ee67c84a37ef9 /sleekxmpp/basexmpp.py | |
parent | 71ad715caaeb43517e5175380d3256d8a8cf1141 (diff) | |
download | slixmpp-a2719b0bb0d4ac26f30c462e6eebb32965637d34.tar.gz slixmpp-a2719b0bb0d4ac26f30c462e6eebb32965637d34.tar.bz2 slixmpp-a2719b0bb0d4ac26f30c462e6eebb32965637d34.tar.xz slixmpp-a2719b0bb0d4ac26f30c462e6eebb32965637d34.zip |
plugins now are checked for post_init having ran when process() is called
Diffstat (limited to 'sleekxmpp/basexmpp.py')
-rw-r--r-- | sleekxmpp/basexmpp.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sleekxmpp/basexmpp.py b/sleekxmpp/basexmpp.py index 292a2088..907067fa 100644 --- a/sleekxmpp/basexmpp.py +++ b/sleekxmpp/basexmpp.py @@ -85,8 +85,13 @@ class basexmpp(object): self.jid = self.getjidbare(jid) self.username = jid.split('@', 1)[0] self.server = jid.split('@',1)[-1].split('/', 1)[0] + + def process(self, *args, **kwargs): + for idx in self.plugin: + if not self.plugin[idx].post_inited: self.plugin[idx].post_init() + return super(basexmpp, self).process(*args, **kwargs) - def registerPlugin(self, plugin, pconfig = {}, run_post=True): + def registerPlugin(self, plugin, pconfig = {}): """Register a plugin not in plugins.__init__.__all__ but in the plugins directory.""" # discover relative "path" to the plugins module from the main app, and import it. @@ -100,8 +105,6 @@ class basexmpp(object): if hasattr(self.plugin[plugin], 'xep'): xep = "(XEP-%s) " % self.plugin[plugin].xep logging.debug("Loaded Plugin %s%s" % (xep, self.plugin[plugin].description)) - if run_post: - self.plugin[plugin].post_init() def register_plugins(self): """Initiates all plugins in the plugins/__init__.__all__""" |