summaryrefslogtreecommitdiff
path: root/sleekxmpp/xmlstream/stanzabase.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-02-14 13:49:43 -0500
committerLance Stout <lancestout@gmail.com>2011-02-14 13:49:43 -0500
commit75584d7ad74b284d30164cde0b5efec2c845d207 (patch)
treee171f1dcd9cd46c5be823cb19233311b49938f70 /sleekxmpp/xmlstream/stanzabase.py
parente0f9025e7c6fe51243222aeb684b94eda1a2be5f (diff)
downloadslixmpp-75584d7ad74b284d30164cde0b5efec2c845d207.tar.gz
slixmpp-75584d7ad74b284d30164cde0b5efec2c845d207.tar.bz2
slixmpp-75584d7ad74b284d30164cde0b5efec2c845d207.tar.xz
slixmpp-75584d7ad74b284d30164cde0b5efec2c845d207.zip
Remap old method names in a better way.
This should prevent some reference cycles that will cause garbage collection issues.
Diffstat (limited to 'sleekxmpp/xmlstream/stanzabase.py')
-rw-r--r--sleekxmpp/xmlstream/stanzabase.py45
1 files changed, 22 insertions, 23 deletions
diff --git a/sleekxmpp/xmlstream/stanzabase.py b/sleekxmpp/xmlstream/stanzabase.py
index 1f229cea..753977c1 100644
--- a/sleekxmpp/xmlstream/stanzabase.py
+++ b/sleekxmpp/xmlstream/stanzabase.py
@@ -218,18 +218,6 @@ class ElementBase(object):
xml -- Initialize the stanza with optional existing XML.
parent -- Optional stanza object that contains this stanza.
"""
- # To comply with PEP8, method names now use underscores.
- # Deprecated method names are re-mapped for backwards compatibility.
- self.initPlugin = self.init_plugin
- self._getAttr = self._get_attr
- self._setAttr = self._set_attr
- self._delAttr = self._del_attr
- self._getSubText = self._get_sub_text
- self._setSubText = self._set_sub_text
- self._delSub = self._del_sub
- self.getStanzaValues = self._get_stanza_values
- self.setStanzaValues = self._set_stanza_values
-
self.xml = xml
self.plugins = OrderedDict()
self.iterables = []
@@ -1076,17 +1064,6 @@ class StanzaBase(ElementBase):
sfrom -- Optional string or JID object of the sender's JID.
sid -- Optional ID value for the stanza.
"""
- # To comply with PEP8, method names now use underscores.
- # Deprecated method names are re-mapped for backwards compatibility.
- self.setType = self.set_type
- self.getTo = self.get_to
- self.setTo = self.set_to
- self.getFrom = self.get_from
- self.setFrom = self.set_from
- self.getPayload = self.get_payload
- self.setPayload = self.set_payload
- self.delPayload = self.del_payload
-
self.stream = stream
if stream is not None:
self.namespace = stream.default_ns
@@ -1224,3 +1201,25 @@ class StanzaBase(ElementBase):
return tostring(self.xml, xmlns='',
stanza_ns=self.namespace,
stream=self.stream)
+
+
+# To comply with PEP8, method names now use underscores.
+# Deprecated method names are re-mapped for backwards compatibility.
+ElementBase.initPlugin = ElementBase.init_plugin
+ElementBase._getAttr = ElementBase._get_attr
+ElementBase._setAttr = ElementBase._set_attr
+ElementBase._delAttr = ElementBase._del_attr
+ElementBase._getSubText = ElementBase._get_sub_text
+ElementBase._setSubText = ElementBase._set_sub_text
+ElementBase._delSub = ElementBase._del_sub
+ElementBase.getStanzaValues = ElementBase._get_stanza_values
+ElementBase.setStanzaValues = ElementBase._set_stanza_values
+
+StanzaBase.setType = StanzaBase.set_type
+StanzaBase.getTo = StanzaBase.get_to
+StanzaBase.setTo = StanzaBase.set_to
+StanzaBase.getFrom = StanzaBase.get_from
+StanzaBase.setFrom = StanzaBase.set_from
+StanzaBase.getPayload = StanzaBase.get_payload
+StanzaBase.setPayload = StanzaBase.set_payload
+StanzaBase.delPayload = StanzaBase.del_payload