Bump to 1.3.1
[slixmpp.git] / sleekxmpp / plugins / xep_0224 / stanza.py
blobf15172d973e1d80c9ea60f99dcc1a3b37086f8e2
1 """
2 SleekXMPP: The Sleek XMPP Library
3 Copyright (C) 2011 Nathanael C. Fritz, Lance J.T. Stout
4 This file is part of SleekXMPP.
6 See the file LICENSE for copying permission.
7 """
9 from sleekxmpp.xmlstream import ElementBase, ET
12 class Attention(ElementBase):
14 """
15 """
17 name = 'attention'
18 namespace = 'urn:xmpp:attention:0'
19 plugin_attrib = 'attention'
20 interfaces = set(('attention',))
21 is_extension = True
23 def setup(self, xml):
24 return True
26 def set_attention(self, value):
27 if value:
28 xml = ET.Element(self.tag_name())
29 self.parent().xml.append(xml)
30 else:
31 self.del_attention()
33 def get_attention(self):
34 xml = self.parent().xml.find(self.tag_name())
35 return xml is not None
37 def del_attention(self):
38 xml = self.parent().xml.find(self.tag_name())
39 if xml is not None:
40 self.parent().xml.remove(xml)