headstock
Latest version: 0.2.0 (development)
This page is updated for headstock 0.2.0
What is it?
A Python library to handle the XMPP protocol and extensions.
License
headstock is released under the modified BSD license.
Download it
- easy_install -U headstock
- Tarball: http://www.defuze.org/oss/headstock/
- svn co https://svn.defuze.org/oss/headstock
Requirements
Both Axon and Kamaelia need to be checked out to work with headstock.
Example
headstock source code comes with a simple chat example that illustrates the usage of headstock. It's not GUI bound as it just demonstrates how to setup headstock.
To run that example and assuming you've installed the requirements:
# Registering a new user (if the server supports XEP-0077 of in-band registration) python simplechat.py -u username -p password -d XMPPdomain -a hostname:port --register # Signing in python simplechat.py -u username -p password -d XMPPdomain -a hostname:port
You ought to install ejabberd before hand if you don't have an XMPP server at hand. I run it as a regular user in my home directory.
You might want to try to connect to Google Talk:
python simplechat.py -u gmail_user -p gmail_password -d gmail.com -a talk.google.com:5222 --usetls
To send a message to a contact type in the console:
contact_email a message
Running the simplechat demo on IronPython? 2
- First grab a copy of IronPython? 2 from http://www.codeplex.com/IronPython.
- Install it with the stdlib option enabled (or alternatively make sure the Python stdlib is reachable by IronPython?)
- Patch the logging module as shown in Fepy: https://fepy.svn.sourceforge.net/svnroot/fepy/trunk/patches/stdlib/2.4.4/patch-stdlib-logging-getframe
- Copy the following modules into IRONPYTHONPATH\Lib\site-packages:
- bridge
- headstock
- Axon
- Kamaelia
- Make sure you don't copy the setuptools eggs but the package themselves. Make also sure you get all the previous code from subversion rather than releases.
You should be able to run the simplechat demo as shown previously.
To make a more interactive tests, you should create two accounts on a localhost server and make them contacts before running the demo.
Unfortunately the TLS support doesn't seem to work yet.
See also
- A quick word about Kamaelia
- jlib for an integration of headstock with PyQt4
- headstock/Microblogging a microblogging example
