source: ralphm-patches/py3-component.patch

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

Start port to Python 3.

File size: 3.5 KB
  • wokkel/component.py

    # HG changeset patch
    # Parent  15fb602347904ff6e41ca63421c07c23e6974c56
    
    diff --git a/wokkel/component.py b/wokkel/component.py
    a b  
    77XMPP External Component utilities.
    88"""
    99
     10from __future__ import division, absolute_import
     11
    1012from twisted.application import service
    1113from twisted.internet import reactor
    1214from twisted.python import log
     15from twisted.python.compat import unicode
    1316from twisted.words.protocols.jabber.jid import internJID as JID
    1417from twisted.words.protocols.jabber import component, error, xmlstream
    1518from twisted.words.xish import domish
     
    102105    components of this type connect to a router in the same process. This
    103106    allows for one-process XMPP servers.
    104107
    105     @ivar domains: Domains (as C{str}) this component will handle traffic for.
    106     @type domains: C{set}
     108    @ivar domains: Domains (as L{unicode}) this component will handle traffic
     109        for.
     110    @type domains: L{set}
    107111    """
    108112
    109113    def __init__(self, router, domain=None):
     
    173177    Authenticator for accepting components.
    174178
    175179    @ivar secret: The shared used to authorized incoming component connections.
    176     @type secret: C{unicode}.
     180    @type secret: L{unicode}.
    177181    """
    178182
    179183    namespace = NS_COMPONENT_ACCEPT
     
    274278    Connected components are trusted to have correct addressing in the
    275279    stanzas they offer for routing.
    276280
    277     A route destination of C{None} adds a default route. Traffic for which no
     281    A route destination of L{None} adds a default route. Traffic for which no
    278282    specific route exists, will be routed to this default route.
    279283
    280284    @ivar routes: Routes based on the host part of JIDs. Maps host names to the
    281285        L{EventDispatcher<twisted.words.xish.utility.EventDispatcher>}s that
    282         should receive the traffic. A key of C{None} means the default route.
    283     @type routes: C{dict}
     286        should receive the traffic. A key of L{None} means the default route.
     287    @type routes: L{dict}
    284288    """
    285289
    286290    def __init__(self):
     
    296300        C{destination} will be passed to this stream.
    297301
    298302        @param destination: Destination of the route to be added as a host name
    299                             or C{None} for the default route.
    300         @type destination: C{str} or C{NoneType}
     303                            or L{None} for the default route.
     304        @type destination: L{unicode} or L{NoneType}
    301305
    302306        @param xs: XML Stream to register the route for.
    303307        @type xs:
     
    312316        Remove a route.
    313317
    314318        @param destination: Destination of the route that should be removed.
    315         @type destination: C{str}.
     319        @type destination: L{unicode}
    316320
    317321        @param xs: XML Stream to remove the route for.
    318322        @type xs:
  • wokkel/test/test_component.py

    diff --git a/wokkel/test/test_component.py b/wokkel/test/test_component.py
    a b  
    55Tests for L{wokkel.component}.
    66"""
    77
     8from __future__ import division, absolute_import
     9
    810from zope.interface.verify import verifyObject
    911
    1012from twisted.internet.base import BaseConnector
     
    312314        """
    313315        Test routing of a message using the default route.
    314316
    315         The default route is the one with C{None} as its key in the
     317        The default route is the one with L{None} as its key in the
    316318        routing table. It is taken when there is no more specific route
    317319        in the routing table that matches the stanza's destination.
    318320        """
Note: See TracBrowser for help on using the repository browser.