source: ralphm-patches/py3-ping.patch @ 78:361e2111a663

Last change on this file since 78:361e2111a663 was 78:361e2111a663, checked in by Ralph Meijer <ralphm@…>, 6 years ago

Start port to Python 3.

File size: 1.4 KB
RevLine 
[78]1# HG changeset patch
2# Parent  0e43b416d911ce2732fca2f705a25ce7e14a8742
3
4diff --git a/wokkel/ping.py b/wokkel/ping.py
5--- a/wokkel/ping.py
6+++ b/wokkel/ping.py
7@@ -10,7 +10,9 @@
8 U{XEP-0199<http://xmpp.org/extensions/xep-0199.html>}.
9 """
10 
11-from zope.interface import implements
12+from __future__ import division, absolute_import
13+
14+from zope.interface import implementer
15 
16 from twisted.words.protocols.jabber.error import StanzaError
17 from twisted.words.protocols.jabber.xmlstream import IQ, toResponse
18@@ -56,7 +58,7 @@
19         request.addElement((NS_PING, 'ping'))
20 
21         if sender is not None:
22-            request['from'] = unicode(sender)
23+            request['from'] = sender.full()
24 
25         d = request.send(entity.full())
26         d.addCallbacks(cb, eb)
27@@ -64,6 +66,7 @@
28 
29 
30 
31+@implementer(iwokkel.IDisco)
32 class PingHandler(XMPPHandler):
33     """
34     Ping responder.
35@@ -71,8 +74,6 @@
36     This handler waits for XMPP Ping requests and sends a response.
37     """
38 
39-    implements(iwokkel.IDisco)
40-
41     def connectionInitialized(self):
42         """
43         Called when the XML stream has been initialized.
44diff --git a/wokkel/test/test_ping.py b/wokkel/test/test_ping.py
45--- a/wokkel/test/test_ping.py
46+++ b/wokkel/test/test_ping.py
47@@ -5,6 +5,8 @@
48 Tests for L{wokkel.ping}.
49 """
50 
51+from __future__ import division, absolute_import
52+
53 from zope.interface import verify
54 
55 from twisted.internet import defer
Note: See TracBrowser for help on using the repository browser.