diff options
author | Nathan Fritz <nathan@andyet.net> | 2010-05-26 10:51:51 -0700 |
---|---|---|
committer | Nathan Fritz <nathan@andyet.net> | 2010-05-26 10:51:51 -0700 |
commit | f4bc9d9722ea57b5f5d22efeb6bc65cb990e1053 (patch) | |
tree | 0b10ae2046996ce19efc29a701fc4cb9ed86c2d1 /sleekxmpp/basexmpp.py | |
parent | 9cfe19c1e14f7045684ed523b65cdbdf3ab48b2e (diff) | |
download | slixmpp-f4bc9d9722ea57b5f5d22efeb6bc65cb990e1053.tar.gz slixmpp-f4bc9d9722ea57b5f5d22efeb6bc65cb990e1053.tar.bz2 slixmpp-f4bc9d9722ea57b5f5d22efeb6bc65cb990e1053.tar.xz slixmpp-f4bc9d9722ea57b5f5d22efeb6bc65cb990e1053.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__""" |