diff options
author | Lance Stout <lancestout@gmail.com> | 2010-10-01 22:24:19 -0400 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2010-10-01 23:56:46 -0400 |
commit | 9f0baec7b2f531ec4c81059715c7dd622ffcd0ae (patch) | |
tree | 1aea3cfc74cdd7cac14d6760f9eda4d392458e84 /sleekxmpp/__init__.py | |
parent | 433c1476270973812dad0ba89911630bd1df2ea1 (diff) | |
download | slixmpp-9f0baec7b2f531ec4c81059715c7dd622ffcd0ae.tar.gz slixmpp-9f0baec7b2f531ec4c81059715c7dd622ffcd0ae.tar.bz2 slixmpp-9f0baec7b2f531ec4c81059715c7dd622ffcd0ae.tar.xz slixmpp-9f0baec7b2f531ec4c81059715c7dd622ffcd0ae.zip |
Made first pass at cleaning BaseXMPP.
Have not intregrated the new JID class yet.
Diffstat (limited to 'sleekxmpp/__init__.py')
-rw-r--r-- | sleekxmpp/__init__.py | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/sleekxmpp/__init__.py b/sleekxmpp/__init__.py index afb7d9d4..933f661f 100644 --- a/sleekxmpp/__init__.py +++ b/sleekxmpp/__init__.py @@ -8,7 +8,7 @@ See the file LICENSE for copying permission. """ from __future__ import absolute_import, unicode_literals -from . basexmpp import basexmpp +from . basexmpp import BaseXMPP, basexmpp from xml.etree import cElementTree as ET from . xmlstream.xmlstream import XMLStream from . xmlstream.xmlstream import RestartStream @@ -39,17 +39,17 @@ except ImportError: #class PresenceStanzaType(object): # # def fromXML(self, xml): + # self.ptype = xml.get('type') -class ClientXMPP(basexmpp, XMLStream): +class ClientXMPP(BaseXMPP): """SleekXMPP's client class. Use only for good, not evil.""" def __init__(self, jid, password, ssl=False, plugin_config = {}, plugin_whitelist=[], escape_quotes=True): + BaseXMPP.__init__(self, 'jabber:client') global srvsupport - XMLStream.__init__(self) self.default_ns = 'jabber:client' - basexmpp.__init__(self) self.plugin_config = plugin_config self.escape_quotes = escape_quotes self.set_jid(jid) @@ -80,16 +80,6 @@ class ClientXMPP(basexmpp, XMLStream): #self.registerStanzaExtension('PresenceStanza', PresenceStanzaType) #self.register_plugins() - 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 connect(self, address=tuple()): """Connect to the Jabber Server. Attempts SRV lookup, and if it fails, uses the JID server.""" |