Python 2.6+/3.1+ XMPP Library
Find a file
Brian Beggs e0c32b6d9b Fixes for disconnection problems detailed in http://github.com/fritzy/SleekXMPP/issues/#issue/20
Fixes to both ClientXMPP & xmlstream.  ClientXMPP was not tracking the changes to authenticated and sessionstarted after the client was disconnected.

xmlstream had some funkyness with state in the _process method that was cleaned up and hopefully made a little cleaner.

Also changed a DNS issue that was occuring that rendered me unable to disconnect.  I would recieve the following error upon reconnect.
Exception in thread process:
Exception in thread process:
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/threading.py", line 532, in __bootstrap_inner
    self.run()
  File "/usr/local/lib/python2.6/threading.py", line 484, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/macdiesel/tmp/workspace/SleekXMPP/sleekxmpp/xmlstream/xmlstream.py", line 202, in _process
    self.reconnect()
  File "/home/macdiesel/tmp/workspace/SleekXMPP/sleekxmpp/__init__.py", line 134, in reconnect
    XMLStream.reconnect(self)
  File "/home/macdiesel/tmp/workspace/SleekXMPP/sleekxmpp/xmlstream/xmlstream.py", line 289, in reconnect
    self.connect()
  File "/home/macdiesel/tmp/workspace/SleekXMPP/sleekxmpp/__init__.py", line 99, in connect
    answers = dns.resolver.query("_xmpp-client._tcp.%s" % self.server, "SRV")
  File "/usr/local/lib/python2.6/site-packages/dns/resolver.py", line 732, in query
    return get_default_resolver().query(qname, rdtype, rdclass, tcp, source)
  File "/usr/local/lib/python2.6/site-packages/dns/resolver.py", line 617, in query
    source=source)
  File "/usr/local/lib/python2.6/site-packages/dns/query.py", line 113, in udp
    wire = q.to_wire()
  File "/usr/local/lib/python2.6/site-packages/dns/message.py", line 404, in to_wire
    r.add_question(rrset.name, rrset.rdtype, rrset.rdclass)
  File "/usr/local/lib/python2.6/site-packages/dns/renderer.py", line 152, in add_question
    self.output.write(struct.pack("!HH", rdtype, rdclass))
TypeError: unsupported operand type(s) for &: 'unicode' and 'long'

Seems I was getting this error when calling line 99 in ClientXMPP.  You can't bit-shift a 1 and a string and this is why this error is coming up. I removed the "SRV" argument and used the default of 1.  not sure exactly what this should be so it may need to be fixed back before it's merged back to trunk.

The line in question:
answers = dns.resolver.query("_xmpp-client._tcp.%s" % self.server, "SRV")
2010-05-13 04:43:25 +08:00
conn_tests Merge branch 'master' of git@github.com:fritzy/SleekXMPP 2010-05-11 12:21:02 -07:00
sleekxmpp Fixes for disconnection problems detailed in http://github.com/fritzy/SleekXMPP/issues/#issue/20 2010-05-13 04:43:25 +08:00
tests forgot to add file required to pass testall.py 2010-04-22 23:40:50 -07:00
.gitignore Fixes for disconnection problems detailed in http://github.com/fritzy/SleekXMPP/issues/#issue/20 2010-05-13 04:43:25 +08:00
example.py fixed some presence bugs 2010-02-27 02:02:08 +00:00
ez_setup.py moved seesmic branch to trunk 2009-06-03 22:56:51 +00:00
INSTALL Added readme and install 2010-01-20 00:19:30 -08:00
LICENSE changed license to MIT 2010-03-26 14:32:16 -07:00
MANIFEST moved seesmic branch to trunk 2009-06-03 22:56:51 +00:00
README Added readme and install 2010-01-20 00:19:30 -08:00
setup.py changed license to MIT 2010-03-26 14:32:16 -07:00
testall.py fixed setup.py issue with unicode in 3.x 2010-01-29 23:57:57 -08:00

SleekXMPP is an XMPP library written for Python 3.x (with 2.6 compatibility).
Featured in examples in XMPP: The Definitive Guide by Kevin Smith, Remko Tronçon, and Peter Saint-Andre

SleekXMPP has several design goals/philosophies:
- Low number of dependencies.
- Every XEP as a plugin.
- Rewarding to work with.

The goals for 1.0 include (and we're getting close):
- Nearly Full test coverage of stanzas.
- Wide range of functional tests.
- Stanza objects for all interaction with the stream
- Documentation on using and extending SleekXMPP.
- Complete documentation on all implemented stanza objects
- Documentation on all examples used in XMPP: The Definitive Guide

1.1 will include:
- More functional and unit tests
- PEP-8 compliance
- XEP-225 support

Since 0.2, here's the Changelog:
- MANY bugfixes
- Re-implementation of handlers/threading to greatly simplify and remove bugs (no more spawning threads in handlers)
- Stanza objects for jabber:client and all implemented XEPs
- Raising XMPPError for jabber:client and extended errors in handlers
- Robust error handling and better insurance of iq responses
- Stanza objects have made life a lot easier!
- Massive audit/cleanup.

Credits
----------------
Main Author: Nathan Fritz fritz@netflint.net
XEP-0045 original implementation: Kevin Smith
Patches: Remko Tronçon

Feel free to add fritzy@netflint.net to your roster for direct support and comments.