Created
May 28, 2010 04:34
-
-
Save legastero/416752 to your computer and use it in GitHub Desktop.
Code example #1 in creating custom stanza objects using the Task example.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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