summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0199/ping.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-03-12 00:18:33 -0700
committerLance Stout <lancestout@gmail.com>2012-03-12 19:32:19 -0700
commit5a324c01de8cbca09609d7176306322bf24df414 (patch)
tree56c129eec1b3b3add34737ac311f769a3084a0f7 /sleekxmpp/plugins/xep_0199/ping.py
parent17279de4a366bdec55382ff20fdee825f003bb4d (diff)
downloadslixmpp-5a324c01de8cbca09609d7176306322bf24df414.tar.gz
slixmpp-5a324c01de8cbca09609d7176306322bf24df414.tar.bz2
slixmpp-5a324c01de8cbca09609d7176306322bf24df414.tar.xz
slixmpp-5a324c01de8cbca09609d7176306322bf24df414.zip
Move XEP-0199 to new system.
Diffstat (limited to 'sleekxmpp/plugins/xep_0199/ping.py')
-rw-r--r--sleekxmpp/plugins/xep_0199/ping.py20
1 files changed, 7 insertions, 13 deletions
diff --git a/sleekxmpp/plugins/xep_0199/ping.py b/sleekxmpp/plugins/xep_0199/ping.py
index a0f60532..851e5ae5 100644
--- a/sleekxmpp/plugins/xep_0199/ping.py
+++ b/sleekxmpp/plugins/xep_0199/ping.py
@@ -15,14 +15,14 @@ from sleekxmpp.exceptions import IqError, IqTimeout
from sleekxmpp.xmlstream import register_stanza_plugin
from sleekxmpp.xmlstream.matcher import StanzaPath
from sleekxmpp.xmlstream.handler import Callback
-from sleekxmpp.plugins.base import base_plugin
+from sleekxmpp.plugins import BasePlugin
from sleekxmpp.plugins.xep_0199 import stanza, Ping
log = logging.getLogger(__name__)
-class xep_0199(base_plugin):
+class XEP_0199(BasePlugin):
"""
XEP-0199: XMPP Ping
@@ -47,14 +47,15 @@ class xep_0199(base_plugin):
round trip time.
"""
+ name = 'xep_0199'
+ description = 'XEP-0199: XMPP Ping'
+ dependencies = set(['xep_0030'])
+ stanza = stanza
+
def plugin_init(self):
"""
Start the XEP-0199 plugin.
"""
- self.description = 'XMPP Ping'
- self.xep = '0199'
- self.stanza = stanza
-
self.keepalive = self.config.get('keepalive', False)
self.frequency = float(self.config.get('frequency', 300))
self.timeout = self.config.get('timeout', 30)
@@ -73,9 +74,6 @@ class xep_0199(base_plugin):
self.xmpp.add_event_handler('session_end',
self._handle_session_end)
- def post_init(self):
- """Handle cross-plugin dependencies."""
- base_plugin.post_init(self)
self.xmpp['xep_0030'].add_feature(Ping.namespace)
def _handle_keepalive(self, event):
@@ -169,7 +167,3 @@ class xep_0199(base_plugin):
log.debug("Pong: %s %f", jid, delay)
return delay
-
-
-# Backwards compatibility for names
-xep_0199.sendPing = xep_0199.send_ping