summaryrefslogtreecommitdiff
path: root/sleekxmpp/stanza/presence.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/presence.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/presence.py')
-rw-r--r--sleekxmpp/stanza/presence.py30
1 files changed, 10 insertions, 20 deletions
diff --git a/sleekxmpp/stanza/presence.py b/sleekxmpp/stanza/presence.py
index 60dddf64..c8706233 100644
--- a/sleekxmpp/stanza/presence.py
+++ b/sleekxmpp/stanza/presence.py
@@ -72,26 +72,6 @@ class Presence(RootStanza):
'subscribed', 'unsubscribe', 'unsubscribed'))
showtypes = set(('dnd', 'chat', 'xa', 'away'))
- def setup(self, xml=None):
- """
- Populate the stanza object using an optional XML object.
-
- Overrides ElementBase.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.setShow = self.set_show
- self.getType = self.get_type
- self.setType = self.set_type
- self.delType = self.get_type
- self.getPriority = self.get_priority
- self.setPriority = self.set_priority
-
- return StanzaBase.setup(self, xml)
-
def exception(self, e):
"""
Override exception passback for presence.
@@ -188,3 +168,13 @@ class Presence(RootStanza):
elif self['type'] == 'subscribe':
self['type'] = 'subscribed'
return StanzaBase.reply(self, clear)
+
+
+# To comply with PEP8, method names now use underscores.
+# Deprecated method names are re-mapped for backwards compatibility.
+Presence.setShow = Presence.set_show
+Presence.getType = Presence.get_type
+Presence.setType = Presence.set_type
+Presence.delType = Presence.get_type
+Presence.getPriority = Presence.get_priority
+Presence.setPriority = Presence.set_priority