From b8e091233e152572786080f21cdc8d1b844912ed Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Tue, 20 Sep 2016 16:34:48 +0900 Subject: XEP-0004: Remove deprecated getXML() and fromXML() methods. --- slixmpp/plugins/xep_0004/stanza/form.py | 12 ------------ slixmpp/plugins/xep_0045.py | 6 +++--- 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): -- cgit v1.2.3