diff options
author | Thom Nichols <tmnichols@gmail.com> | 2010-06-01 22:40:37 -0400 |
---|---|---|
committer | Thom Nichols <tmnichols@gmail.com> | 2010-06-01 22:40:37 -0400 |
commit | 1780ca900a9a78347745d95e7d8934ffae9d7594 (patch) | |
tree | b65b78a036ac8ec7b63d6c620a73e22ed10f2aed /sleekxmpp/componentxmpp.py | |
parent | 8e95ae2948228ddc6d1b32eca2e64b847c756a71 (diff) | |
parent | e6c2fde2834fafbc35b52da7e523f2b351f53a15 (diff) | |
download | slixmpp-1780ca900a9a78347745d95e7d8934ffae9d7594.tar.gz slixmpp-1780ca900a9a78347745d95e7d8934ffae9d7594.tar.bz2 slixmpp-1780ca900a9a78347745d95e7d8934ffae9d7594.tar.xz slixmpp-1780ca900a9a78347745d95e7d8934ffae9d7594.zip |
merged a lot of fritzy's changes
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) |