diff options
author | Lance Stout <lancestout@gmail.com> | 2011-02-14 16:18:44 -0500 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2011-02-14 16:18:44 -0500 |
commit | a278f79bdbdb842193092a9e0176ecb8b1867762 (patch) | |
tree | c55be3e45f61133c01969be201d3a6476dbe5762 /sleekxmpp/plugins/xep_0009/stanza | |
parent | 606c369173e7a31d793540d90e425a78c2a81253 (diff) | |
parent | d709f8db657aa1d1314082d842dd29e2546739c4 (diff) | |
download | slixmpp-a278f79bdbdb842193092a9e0176ecb8b1867762.tar.gz slixmpp-a278f79bdbdb842193092a9e0176ecb8b1867762.tar.bz2 slixmpp-a278f79bdbdb842193092a9e0176ecb8b1867762.tar.xz slixmpp-a278f79bdbdb842193092a9e0176ecb8b1867762.zip |
Merge branch 'develop' into roster
Conflicts:
sleekxmpp/clientxmpp.py
Diffstat (limited to 'sleekxmpp/plugins/xep_0009/stanza')
-rw-r--r-- | sleekxmpp/plugins/xep_0009/stanza/RPC.py | 64 | ||||
-rw-r--r-- | sleekxmpp/plugins/xep_0009/stanza/__init__.py | 9 |
2 files changed, 73 insertions, 0 deletions
diff --git a/sleekxmpp/plugins/xep_0009/stanza/RPC.py b/sleekxmpp/plugins/xep_0009/stanza/RPC.py new file mode 100644 index 00000000..3d1c77a2 --- /dev/null +++ b/sleekxmpp/plugins/xep_0009/stanza/RPC.py @@ -0,0 +1,64 @@ +""" + SleekXMPP: The Sleek XMPP Library + Copyright (C) 2011 Nathanael C. Fritz, Dann Martens (TOMOTON). + This file is part of SleekXMPP. + + See the file LICENSE for copying permission. +""" + +from sleekxmpp.xmlstream.stanzabase import ElementBase +from xml.etree import cElementTree as ET + + +class RPCQuery(ElementBase): + name = 'query' + namespace = 'jabber:iq:rpc' + plugin_attrib = 'rpc_query' + interfaces = set(()) + subinterfaces = set(()) + plugin_attrib_map = {} + plugin_tag_map = {} + + +class MethodCall(ElementBase): + name = 'methodCall' + namespace = 'jabber:iq:rpc' + plugin_attrib = 'method_call' + interfaces = set(('method_name', 'params')) + subinterfaces = set(()) + plugin_attrib_map = {} + plugin_tag_map = {} + + def get_method_name(self): + return self._get_sub_text('methodName') + + def set_method_name(self, value): + return self._set_sub_text('methodName', value) + + def get_params(self): + return self.xml.find('{%s}params' % self.namespace) + + def set_params(self, params): + self.append(params) + + +class MethodResponse(ElementBase): + name = 'methodResponse' + namespace = 'jabber:iq:rpc' + plugin_attrib = 'method_response' + interfaces = set(('params', 'fault')) + subinterfaces = set(()) + plugin_attrib_map = {} + plugin_tag_map = {} + + def get_params(self): + return self.xml.find('{%s}params' % self.namespace) + + def set_params(self, params): + self.append(params) + + def get_fault(self): + return self.xml.find('{%s}fault' % self.namespace) + + def set_fault(self, fault): + self.append(fault) diff --git a/sleekxmpp/plugins/xep_0009/stanza/__init__.py b/sleekxmpp/plugins/xep_0009/stanza/__init__.py new file mode 100644 index 00000000..5dcbf330 --- /dev/null +++ b/sleekxmpp/plugins/xep_0009/stanza/__init__.py @@ -0,0 +1,9 @@ +""" + SleekXMPP: The Sleek XMPP Library + Copyright (C) 2011 Nathanael C. Fritz, Dann Martens (TOMOTON). + This file is part of SleekXMPP. + + See the file LICENSE for copying permission. +""" + +from sleekxmpp.plugins.xep_0009.stanza.RPC import RPCQuery, MethodCall, MethodResponse |