summaryrefslogtreecommitdiff
path: root/sleekxmpp
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
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')
-rw-r--r--sleekxmpp/plugins/xep_0199/__init__.py12
-rw-r--r--sleekxmpp/plugins/xep_0199/ping.py20
2 files changed, 18 insertions, 14 deletions
diff --git a/sleekxmpp/plugins/xep_0199/__init__.py b/sleekxmpp/plugins/xep_0199/__init__.py
index 3444fe94..5231a5b5 100644
--- a/sleekxmpp/plugins/xep_0199/__init__.py
+++ b/sleekxmpp/plugins/xep_0199/__init__.py
@@ -6,5 +6,15 @@
See the file LICENSE for copying permission.
"""
+from sleekxmpp.plugins.base import register_plugin
+
from sleekxmpp.plugins.xep_0199.stanza import Ping
-from sleekxmpp.plugins.xep_0199.ping import xep_0199
+from sleekxmpp.plugins.xep_0199.ping import XEP_0199
+
+
+register_plugin(XEP_0199)
+
+
+# Backwards compatibility for names
+xep_0199 = XEP_0199
+xep_0199.sendPing = xep_0199.send_ping
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