summaryrefslogtreecommitdiff
path: root/sleekxmpp/stanza/nick.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/nick.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/nick.py')
-rw-r--r--sleekxmpp/stanza/nick.py23
1 files changed, 6 insertions, 17 deletions
diff --git a/sleekxmpp/stanza/nick.py b/sleekxmpp/stanza/nick.py
index dce41d14..1e23d34f 100644
--- a/sleekxmpp/stanza/nick.py
+++ b/sleekxmpp/stanza/nick.py
@@ -49,23 +49,6 @@ class Nick(ElementBase):
plugin_attrib = name
interfaces = set(('nick',))
- 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.setNick = self.set_nick
- self.getNick = self.get_nick
- self.delNick = self.del_nick
-
- return ElementBase.setup(self, xml)
-
def set_nick(self, nick):
"""
Add a <nick> element with the given nickname.
@@ -87,3 +70,9 @@ class Nick(ElementBase):
register_stanza_plugin(Message, Nick)
register_stanza_plugin(Presence, Nick)
+
+# To comply with PEP8, method names now use underscores.
+# Deprecated method names are re-mapped for backwards compatibility.
+Nick.setNick = Nick.set_nick
+Nick.getNick = Nick.get_nick
+Nick.delNick = Nick.del_nick