source: ralphm-patches/py3-ping.patch @ 83:255aae0cf8c5

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

Start port to Python 3.

File size: 1.4 KB
  • wokkel/ping.py

    # HG changeset patch
    # Parent  0e43b416d911ce2732fca2f705a25ce7e14a8742
    
    diff --git a/wokkel/ping.py b/wokkel/ping.py
    a b  
    1010U{XEP-0199<http://xmpp.org/extensions/xep-0199.html>}.
    1111"""
    1212
    13 from zope.interface import implements
     13from __future__ import division, absolute_import
     14
     15from zope.interface import implementer
    1416
    1517from twisted.words.protocols.jabber.error import StanzaError
    1618from twisted.words.protocols.jabber.xmlstream import IQ, toResponse
     
    5658        request.addElement((NS_PING, 'ping'))
    5759
    5860        if sender is not None:
    59             request['from'] = unicode(sender)
     61            request['from'] = sender.full()
    6062
    6163        d = request.send(entity.full())
    6264        d.addCallbacks(cb, eb)
     
    6466
    6567
    6668
     69@implementer(iwokkel.IDisco)
    6770class PingHandler(XMPPHandler):
    6871    """
    6972    Ping responder.
     
    7174    This handler waits for XMPP Ping requests and sends a response.
    7275    """
    7376
    74     implements(iwokkel.IDisco)
    75 
    7677    def connectionInitialized(self):
    7778        """
    7879        Called when the XML stream has been initialized.
  • wokkel/test/test_ping.py

    diff --git a/wokkel/test/test_ping.py b/wokkel/test/test_ping.py
    a b  
    55Tests for L{wokkel.ping}.
    66"""
    77
     8from __future__ import division, absolute_import
     9
    810from zope.interface import verify
    911
    1012from twisted.internet import defer
Note: See TracBrowser for help on using the repository browser.