source: ralphm-patches/py3-disco.patch

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

Start port to Python 3.

File size: 2.5 KB
  • wokkel/disco.py

    # HG changeset patch
    # Parent  b7bf25ca839d7ac87cc565a0374110c49de27d18
    
    diff --git a/wokkel/disco.py b/wokkel/disco.py
    a b  
    1010U{XEP-0030<http://xmpp.org/extensions/xep-0030.html>}.
    1111"""
    1212
     13from __future__ import division, absolute_import
     14
    1315from twisted.internet import defer
     16from twisted.python.compat import iteritems, unicode
    1417from twisted.words.protocols.jabber import error, jid
    1518from twisted.words.xish import domish
    1619
     
    363366            NS_DISCO_ITEMS: 'items',
    364367            }
    365368
    366     _verbRequestMap = dict(((v, k) for k, v in _requestVerbMap.iteritems()))
     369    _verbRequestMap = dict(((v, k) for k, v in iteritems(_requestVerbMap)))
    367370
    368371    def __init__(self, verb=None, nodeIdentifier='',
    369372                       recipient=None, sender=None):
  • wokkel/test/test_disco.py

    diff --git a/wokkel/test/test_disco.py b/wokkel/test/test_disco.py
    a b  
    55Tests for L{wokkel.disco}.
    66"""
    77
    8 from zope.interface import implements
     8from __future__ import division, absolute_import
     9
     10from zope.interface import implementer
    911
    1012from twisted.internet import defer
    1113from twisted.trial import unittest
     
    846848                      disco.DiscoFeature('jabber:iq:version')
    847849        ]
    848850
     851        @implementer(disco.IDisco)
    849852        class DiscoResponder(XMPPHandler):
    850             implements(disco.IDisco)
    851853
    852854            def getDiscoInfo(self, requestor, target, nodeIdentifier):
    853855                if not nodeIdentifier:
     
    873875                      disco.DiscoFeature('jabber:iq:version')
    874876        ]
    875877
     878        @implementer(disco.IDisco)
    876879        class DiscoResponder(XMPPHandler):
    877             implements(disco.IDisco)
    878880
    879881            def getDiscoInfo(self, requestor, target, nodeIdentifier):
    880882                if not nodeIdentifier:
     
    897899        """
    898900        discoItems = [disco.DiscoItem(JID('example.com'), 'test', 'Test node')]
    899901
     902        @implementer(disco.IDisco)
    900903        class DiscoResponder(XMPPHandler):
    901             implements(disco.IDisco)
    902904
    903905            def getDiscoItems(self, requestor, target, nodeIdentifier):
    904906                if not nodeIdentifier:
     
    921923        """
    922924        discoItems = [disco.DiscoItem(JID('example.com'), 'test', 'Test node')]
    923925
     926        @implementer(disco.IDisco)
    924927        class DiscoResponder(XMPPHandler):
    925             implements(disco.IDisco)
    926928
    927929            def getDiscoItems(self, requestor, target, nodeIdentifier):
    928930                if not nodeIdentifier:
Note: See TracBrowser for help on using the repository browser.