Fix the xep_0009 import (no more relatives)
[slixmpp.git] / sleekxmpp / plugins / xep_0009 / stanza / RPC.py
blob3d1c77a2b07a3c74b1c35234fae7aca2a03593f9
1 """
2 SleekXMPP: The Sleek XMPP Library
3 Copyright (C) 2011 Nathanael C. Fritz, Dann Martens (TOMOTON).
4 This file is part of SleekXMPP.
6 See the file LICENSE for copying permission.
7 """
9 from sleekxmpp.xmlstream.stanzabase import ElementBase
10 from xml.etree import cElementTree as ET
13 class RPCQuery(ElementBase):
14 name = 'query'
15 namespace = 'jabber:iq:rpc'
16 plugin_attrib = 'rpc_query'
17 interfaces = set(())
18 subinterfaces = set(())
19 plugin_attrib_map = {}
20 plugin_tag_map = {}
23 class MethodCall(ElementBase):
24 name = 'methodCall'
25 namespace = 'jabber:iq:rpc'
26 plugin_attrib = 'method_call'
27 interfaces = set(('method_name', 'params'))
28 subinterfaces = set(())
29 plugin_attrib_map = {}
30 plugin_tag_map = {}
32 def get_method_name(self):
33 return self._get_sub_text('methodName')
35 def set_method_name(self, value):
36 return self._set_sub_text('methodName', value)
38 def get_params(self):
39 return self.xml.find('{%s}params' % self.namespace)
41 def set_params(self, params):
42 self.append(params)
45 class MethodResponse(ElementBase):
46 name = 'methodResponse'
47 namespace = 'jabber:iq:rpc'
48 plugin_attrib = 'method_response'
49 interfaces = set(('params', 'fault'))
50 subinterfaces = set(())
51 plugin_attrib_map = {}
52 plugin_tag_map = {}
54 def get_params(self):
55 return self.xml.find('{%s}params' % self.namespace)
57 def set_params(self, params):
58 self.append(params)
60 def get_fault(self):
61 return self.xml.find('{%s}fault' % self.namespace)
63 def set_fault(self, fault):
64 self.append(fault)