summaryrefslogtreecommitdiff
path: root/sleekxmpp/stanza/message.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/stanza/message.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/stanza/message.py')
-rw-r--r--sleekxmpp/stanza/message.py32
1 files changed, 11 insertions, 21 deletions
diff --git a/sleekxmpp/stanza/message.py b/sleekxmpp/stanza/message.py
index 6f0cf212..cb3d344c 100644
--- a/sleekxmpp/stanza/message.py
+++ b/sleekxmpp/stanza/message.py
@@ -63,27 +63,6 @@ class Message(RootStanza):
plugin_attrib = name
types = set((None, 'normal', 'chat', 'headline', 'error', 'groupchat'))
- def setup(self, xml=None):
- """
- Populate the stanza object using an optional XML object.
-
- Overrides StanzaBase.setup.
-
- Arguments:
- xml -- Use an existing XML object for the stanza's values.
- """
- # To comply with PEP8, method names now use underscores.
- # Deprecated method names are re-mapped for backwards compatibility.
- self.getType = self.get_type
- self.getMucroom = self.get_mucroom
- self.setMucroom = self.set_mucroom
- self.delMucroom = self.del_mucroom
- self.getMucnick = self.get_mucnick
- self.setMucnick = self.set_mucnick
- self.delMucnick = self.del_mucnick
-
- return StanzaBase.setup(self, xml)
-
def get_type(self):
"""
Return the message type.
@@ -165,3 +144,14 @@ class Message(RootStanza):
def del_mucnick(self):
"""Dummy method to prevent deletion."""
pass
+
+
+# To comply with PEP8, method names now use underscores.
+# Deprecated method names are re-mapped for backwards compatibility.
+Message.getType = Message.get_type
+Message.getMucroom = Message.get_mucroom
+Message.setMucroom = Message.set_mucroom
+Message.delMucroom = Message.del_mucroom
+Message.getMucnick = Message.get_mucnick
+Message.setMucnick = Message.set_mucnick
+Message.delMucnick = Message.del_mucnick