github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

Warbo / pubsubclient

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 8
    • 0
  • Source
  • Commits
  • Network (0)
  • Issues (0)
  • Downloads (0)
  • Wiki (5)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

A Python library to simplify using XMPP Publish-Subscribe (XEP-0060) in an asynchronous and self-contained way. — Read more

  cancel

http://pubsubclient.sourceforge.net/

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Added basic handler for removing items 
Chris Warburton (author)
Thu May 28 12:00:09 -0700 2009
commit  63216b006f1b33bdbd0836a3c2f66481c9ef51d8
tree    37ec71d088efa0f05e07130e8c86f4d57699a44f
parent  6da92196cfa24432e26b49d005d8a360e38c79a8
pubsubclient /
name age
history
message
file COPYING Sat Sep 20 08:38:10 -0700 2008 Committer: Chris Warburton <chris@chris-portabl... [Chris Warburton]
file LEGAL Sat Sep 20 08:38:10 -0700 2008 Committer: Chris Warburton <chris@chris-portabl... [Chris Warburton]
file LEGAL.serversvg Sat Sep 20 08:38:10 -0700 2008 Committer: Chris Warburton <chris@chris-portabl... [Chris Warburton]
file LEGAL.simplexml Sat Sep 20 08:38:10 -0700 2008 Committer: Chris Warburton <chris@chris-portabl... [Chris Warburton]
file README Sat Sep 20 08:38:10 -0700 2008 Committer: Chris Warburton <chris@chris-portabl... [Chris Warburton]
file SPEC-COMPLIANCE Sat Jan 31 16:45:56 -0800 2009 Documented the state of every pubsubclient meth... [Chris Warburton]
file __init__.py Sat Sep 20 08:38:10 -0700 2008 Committer: Chris Warburton <chris@chris-portabl... [Chris Warburton]
file make_start_page.py Sat Sep 20 08:38:10 -0700 2008 Committer: Chris Warburton <chris@chris-portabl... [Chris Warburton]
directory page_settings/ Sat Sep 20 08:38:10 -0700 2008 Committer: Chris Warburton <chris@chris-portabl... [Chris Warburton]
directory pages/ Sat Sep 20 08:38:10 -0700 2008 Committer: Chris Warburton <chris@chris-portabl... [Chris Warburton]
file pubsub_browser.py Sat Dec 13 07:31:35 -0800 2008 Committer: Chris Warburton <chris@chris-portab... [Chris Warburton]
file pubsub_browser.pyc Sat Sep 20 08:38:10 -0700 2008 Committer: Chris Warburton <chris@chris-portabl... [Chris Warburton]
file pubsub_reader.py Sat Jan 31 08:21:48 -0800 2009 Merged some redundant methods. Added Item class. [Chris Warburton]
file pubsub_writer.py Sat Jan 31 08:21:48 -0800 2009 Merged some redundant methods. Added Item class. [Chris Warburton]
file pubsubclient.py Thu May 28 12:00:09 -0700 2009 Added basic handler for removing items [Chris Warburton]
file pubsubclient.pyc Sat Jan 31 08:21:48 -0800 2009 Merged some redundant methods. Added Item class. [Chris Warburton]
file server.svg Sat Sep 20 08:38:10 -0700 2008 Committer: Chris Warburton <chris@chris-portabl... [Chris Warburton]
file simplexml.py Sat Sep 20 08:38:10 -0700 2008 Committer: Chris Warburton <chris@chris-portabl... [Chris Warburton]
file simplexml.pyc Sat Sep 20 08:38:10 -0700 2008 Committer: Chris Warburton <chris@chris-portabl... [Chris Warburton]
file start.html Sat Sep 20 08:38:10 -0700 2008 Committer: Chris Warburton <chris@chris-portabl... [Chris Warburton]
README
PubSubClient is a Python implementation of the XEP-0060 standard,
Publish/Subscribe ("PubSub") over the XMPP messaging network.

To use this library you will need the xmpppy and lxml libraries, then simply put the pubsubclient.py file in your 
project's directory and use "import pubsubclient". PubSubClient is designed to be self-contained as far as input and 
output are concerned, it only accepts and gives back regular Python types (lists, dictionaries, strings, etc.) and its 
own objects.

To use it first make a pubsubclient.PubSubClient object, giving it a JabberID, a password and optionally a resource 
(default is "subscriptions", note that PubSub deals with 'bare' Jabber IDs, ie. no resources). Run the
PubSubClient's connect method and you're ready to go.

The current API is pretty awful. Every message a PubSub entity might
want to send to a server is implemented (pretty much) in a
PubSubClient method, but reply handlers are currently being written. There is also a partially implemented object system 
to make life easier. These objects are currently Node, Server, and JID although any of their methods which send XMPP 
stanzas need to be passed a PubSubClient to send them with.

XMPP, being network based, is best implemented in an asynchronous way.
The method used in PubSubClient is a callback system, where the
outcome of a method is given to a callback function passed as an
argument. For example:

def print_nodes(nodes):
  for node in nodes:
    print node.name

my_node.get_sub_nodes(my_pubsubclient, print_nodes)

Here the function print_nodes will be executed when a reply to the "get_sub_nodes" request is received.

Sorry for the poor documentation, but with refactoring and rewriting going on anything written would soon become 
obsolete. When the API stabilises there shall be some proper documentation.
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server