diff options
author | Nathan Fritz <nathan@andyet.net> | 2010-05-24 14:27:13 -0700 |
---|---|---|
committer | Nathan Fritz <nathan@andyet.net> | 2010-05-24 14:27:13 -0700 |
commit | 3920ee394183d95aa6f5b4ee3c8843c2d34ad4cb (patch) | |
tree | 47c84ffda15050163607ca0b34c300e6454c516b /sleekxmpp | |
parent | feaa7539affa9a451b568b5b1502630cd3833ca3 (diff) | |
download | slixmpp-3920ee394183d95aa6f5b4ee3c8843c2d34ad4cb.tar.gz slixmpp-3920ee394183d95aa6f5b4ee3c8843c2d34ad4cb.tar.bz2 slixmpp-3920ee394183d95aa6f5b4ee3c8843c2d34ad4cb.tar.xz slixmpp-3920ee394183d95aa6f5b4ee3c8843c2d34ad4cb.zip |
added plugin indexing to components
Diffstat (limited to 'sleekxmpp')
-rwxr-xr-x | sleekxmpp/componentxmpp.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sleekxmpp/componentxmpp.py b/sleekxmpp/componentxmpp.py index 9c7a6125..89953687 100755 --- a/sleekxmpp/componentxmpp.py +++ b/sleekxmpp/componentxmpp.py @@ -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) |