diff options
author | Thom Nichols <tmnichols@gmail.com> | 2010-06-01 22:54:30 -0400 |
---|---|---|
committer | Thom Nichols <tmnichols@gmail.com> | 2010-06-01 22:54:30 -0400 |
commit | 49f5767aea2815211349d93aa03ce2b9dc088c1e (patch) | |
tree | 3a63f08d009dc7d16560ac2fc464482649b4cd47 /sleekxmpp/componentxmpp.py | |
parent | 3e83b16a586b34dd686a4aeaea77c50a92f54b51 (diff) | |
parent | e6c2fde2834fafbc35b52da7e523f2b351f53a15 (diff) | |
download | slixmpp-49f5767aea2815211349d93aa03ce2b9dc088c1e.tar.gz slixmpp-49f5767aea2815211349d93aa03ce2b9dc088c1e.tar.bz2 slixmpp-49f5767aea2815211349d93aa03ce2b9dc088c1e.tar.xz slixmpp-49f5767aea2815211349d93aa03ce2b9dc088c1e.zip |
merged changes from fritzy
Diffstat (limited to 'sleekxmpp/componentxmpp.py')
-rwxr-xr-x | sleekxmpp/componentxmpp.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sleekxmpp/componentxmpp.py b/sleekxmpp/componentxmpp.py index 9c7a6125..de125814 100755 --- a/sleekxmpp/componentxmpp.py +++ b/sleekxmpp/componentxmpp.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2.5 +#!/usr/bin/python2.6 """ SleekXMPP: The Sleek XMPP Library @@ -54,6 +54,16 @@ class ComponentXMPP(basexmpp, XMLStream): self.secret = secret self.registerHandler(Callback('Handshake', MatchXPath('{jabber:component:accept}handshake'), self._handleHandshake)) + def __getitem__(self, key): + if key in self.plugin: + return self.plugin[key] + else: + logging.warning("""Plugin "%s" is not loaded.""" % key) + return False + + def get(self, key, default): + return self.plugin.get(key, default) + def incoming_filter(self, xmlobj): if xmlobj.tag.startswith('{jabber:client}'): xmlobj.tag = xmlobj.tag.replace('jabber:client', self.default_ns) |