Skip to content

Instantly share code, notes, and snippets.

@legastero
Created May 28, 2010 04:34
Show Gist options
  • Select an option

  • Save legastero/416752 to your computer and use it in GitHub Desktop.

Select an option

Save legastero/416752 to your computer and use it in GitHub Desktop.
Code example #1 in creating custom stanza objects using the Task example.
import sleekxmpp
from sleekxmpp.xmlstream.stanzabase import ElementBase, ET, JID
from sleekxmpp.stanza.iq import Iq
class Param(ElementBase):
namespace = 'example:task'
name = 'param'
plugin_attrib = 'param'
interfaces = set(('name', 'value'))
sub_interfaces = interfaces
class Task(ElementBase):
namespace = 'example:task'
name = 'task'
plugin_attrib = 'task'
interfaces = set(('id', 'command', 'cleanup', 'params'))
sub_interfaces = set(('command', 'cleanup'))
subitem = (Param,)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment