diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2016-09-20 16:34:48 +0900 |
---|---|---|
committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2016-09-20 16:34:48 +0900 |
commit | b8e091233e152572786080f21cdc8d1b844912ed (patch) | |
tree | 1f2112e954c83de2b589949a63475c15394c7b10 | |
parent | 0edeefd977775ecb1f6c8b114008532b4629041f (diff) | |
download | slixmpp-b8e091233e152572786080f21cdc8d1b844912ed.tar.gz slixmpp-b8e091233e152572786080f21cdc8d1b844912ed.tar.bz2 slixmpp-b8e091233e152572786080f21cdc8d1b844912ed.tar.xz slixmpp-b8e091233e152572786080f21cdc8d1b844912ed.zip |
XEP-0004: Remove deprecated getXML() and fromXML() methods.
-rw-r--r-- | slixmpp/plugins/xep_0004/stanza/form.py | 12 | ||||
-rw-r--r-- | slixmpp/plugins/xep_0045.py | 6 | ||||
-rw-r--r-- | slixmpp/plugins/xep_0060/stanza/pubsub.py | 4 |
3 files changed, 5 insertions, 17 deletions
diff --git a/slixmpp/plugins/xep_0004/stanza/form.py b/slixmpp/plugins/xep_0004/stanza/form.py index 151e2ef1..32bfc0e3 100644 --- a/slixmpp/plugins/xep_0004/stanza/form.py +++ b/slixmpp/plugins/xep_0004/stanza/form.py @@ -81,18 +81,6 @@ class Form(ElementBase): self.append(field) return field - def getXML(self, type='submit'): - self['type'] = type - log.warning("Form.getXML() is deprecated API compatibility " + \ - "with plugins/old_0004.py") - return self.xml - - def fromXML(self, xml): - log.warning("Form.fromXML() is deprecated API compatibility " + \ - "with plugins/old_0004.py") - n = Form(xml=xml) - return n - def add_item(self, values): itemXML = ET.Element('{%s}item' % self.namespace) self.xml.append(itemXML) diff --git a/slixmpp/plugins/xep_0045.py b/slixmpp/plugins/xep_0045.py index e8d2b8cb..7589d3cf 100644 --- a/slixmpp/plugins/xep_0045.py +++ b/slixmpp/plugins/xep_0045.py @@ -222,7 +222,7 @@ class XEP_0045(BasePlugin): if ifrom is not None: iq['from'] = ifrom query = ET.Element('{http://jabber.org/protocol/muc#owner}query') - form = form.getXML('submit') + form['type'] = 'submit' query.append(form) iq.append(query) # For now, swallow errors to preserve existing API @@ -373,8 +373,8 @@ class XEP_0045(BasePlugin): def setRoomConfig(self, room, config, ifrom=''): query = ET.Element('{http://jabber.org/protocol/muc#owner}query') - x = config.getXML('submit') - query.append(x) + config['type'] = 'submit' + query.append(config) iq = self.xmpp.make_iq_set(query) iq['to'] = room iq['from'] = ifrom diff --git a/slixmpp/plugins/xep_0060/stanza/pubsub.py b/slixmpp/plugins/xep_0060/stanza/pubsub.py index b4293918..5e060150 100644 --- a/slixmpp/plugins/xep_0060/stanza/pubsub.py +++ b/slixmpp/plugins/xep_0060/stanza/pubsub.py @@ -206,7 +206,7 @@ class Options(ElementBase): return form def set_options(self, value): - self.xml.append(value.getXML()) + self.xml.append(value) return self def del_options(self): @@ -238,7 +238,7 @@ class PublishOptions(ElementBase): if value is None: self.del_publish_options() else: - self.xml.append(value.getXML()) + self.xml.append(value) return self def del_publish_options(self): |