From 75584d7ad74b284d30164cde0b5efec2c845d207 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Mon, 14 Feb 2011 13:49:43 -0500 Subject: Remap old method names in a better way. This should prevent some reference cycles that will cause garbage collection issues. --- sleekxmpp/plugins/xep_0030/disco.py | 14 ++++++++------ sleekxmpp/plugins/xep_0030/static.py | 1 - sleekxmpp/plugins/xep_0199/ping.py | 7 ++++--- 3 files changed, 12 insertions(+), 10 deletions(-) (limited to 'sleekxmpp/plugins') diff --git a/sleekxmpp/plugins/xep_0030/disco.py b/sleekxmpp/plugins/xep_0030/disco.py index 96aac695..45d6931b 100644 --- a/sleekxmpp/plugins/xep_0030/disco.py +++ b/sleekxmpp/plugins/xep_0030/disco.py @@ -90,10 +90,6 @@ class xep_0030(base_plugin): self.description = 'Service Discovery' self.stanza = sleekxmpp.plugins.xep_0030.stanza - # Retain some backwards compatibility - self.getInfo = self.get_info - self.getItems = self.get_items - self.xmpp.register_handler( Callback('Disco Info', StanzaPath('iq/disco_info'), @@ -124,7 +120,8 @@ class xep_0030(base_plugin): """Handle cross-plugin dependencies.""" base_plugin.post_init(self) if self.xmpp['xep_0059']: - register_stanza_plugin(DiscoItems, self.xmpp['xep_0059'].stanza.Set) + register_stanza_plugin(DiscoItems, + self.xmpp['xep_0059'].stanza.Set) def set_node_handler(self, htype, jid=None, node=None, handler=None): """ @@ -378,7 +375,8 @@ class xep_0030(base_plugin): """ self._run_node_handler('del_item', jid, node, kwargs) - def add_identity(self, category='', itype='', name='', node=None, jid=None, lang=None): + def add_identity(self, category='', itype='', name='', + node=None, jid=None, lang=None): """ Add a new identity to the given JID/node combination. @@ -607,3 +605,7 @@ class xep_0030(base_plugin): info.add_feature(info.namespace) return info + +# Retain some backwards compatibility +xep_0030.getInfo = xep_0030.get_info +xep_0030.getItems = xep_0030.get_items diff --git a/sleekxmpp/plugins/xep_0030/static.py b/sleekxmpp/plugins/xep_0030/static.py index f957c84c..654a9bd0 100644 --- a/sleekxmpp/plugins/xep_0030/static.py +++ b/sleekxmpp/plugins/xep_0030/static.py @@ -262,4 +262,3 @@ class StaticDisco(object): self.nodes[(jid, node)]['items'].del_item( data.get('ijid', ''), node=data.get('inode', None)) - diff --git a/sleekxmpp/plugins/xep_0199/ping.py b/sleekxmpp/plugins/xep_0199/ping.py index cde2f822..064af4ca 100644 --- a/sleekxmpp/plugins/xep_0199/ping.py +++ b/sleekxmpp/plugins/xep_0199/ping.py @@ -54,9 +54,6 @@ class xep_0199(base_plugin): self.xep = '0199' self.stanza = stanza - # Backwards compatibility for names - self.sendPing = self.send_ping - self.keepalive = self.config.get('keepalive', True) self.frequency = float(self.config.get('frequency', 300)) self.timeout = self.config.get('timeout', 30) @@ -160,3 +157,7 @@ class xep_0199(base_plugin): log.debug("Pong: %s %f" % (jid, delay)) return delay + + +# Backwards compatibility for names +Ping.sendPing = Ping.send_ping -- cgit v1.2.3