source:
ralphm-patches/py3-component.patch
Last change on this file was 78:361e2111a663, checked in by Ralph Meijer <ralphm@…>, 6 years ago | |
---|---|
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 7 7 XMPP External Component utilities. 8 8 """ 9 9 10 from __future__ import division, absolute_import 11 10 12 from twisted.application import service 11 13 from twisted.internet import reactor 12 14 from twisted.python import log 15 from twisted.python.compat import unicode 13 16 from twisted.words.protocols.jabber.jid import internJID as JID 14 17 from twisted.words.protocols.jabber import component, error, xmlstream 15 18 from twisted.words.xish import domish … … 102 105 components of this type connect to a router in the same process. This 103 106 allows for one-process XMPP servers. 104 107 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} 107 111 """ 108 112 109 113 def __init__(self, router, domain=None): … … 173 177 Authenticator for accepting components. 174 178 175 179 @ivar secret: The shared used to authorized incoming component connections. 176 @type secret: C{unicode}.180 @type secret: L{unicode}. 177 181 """ 178 182 179 183 namespace = NS_COMPONENT_ACCEPT … … 274 278 Connected components are trusted to have correct addressing in the 275 279 stanzas they offer for routing. 276 280 277 A route destination of C{None} adds a default route. Traffic for which no281 A route destination of L{None} adds a default route. Traffic for which no 278 282 specific route exists, will be routed to this default route. 279 283 280 284 @ivar routes: Routes based on the host part of JIDs. Maps host names to the 281 285 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} 284 288 """ 285 289 286 290 def __init__(self): … … 296 300 C{destination} will be passed to this stream. 297 301 298 302 @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} 301 305 302 306 @param xs: XML Stream to register the route for. 303 307 @type xs: … … 312 316 Remove a route. 313 317 314 318 @param destination: Destination of the route that should be removed. 315 @type destination: C{str}.319 @type destination: L{unicode} 316 320 317 321 @param xs: XML Stream to remove the route for. 318 322 @type xs: -
wokkel/test/test_component.py
diff --git a/wokkel/test/test_component.py b/wokkel/test/test_component.py
a b 5 5 Tests for L{wokkel.component}. 6 6 """ 7 7 8 from __future__ import division, absolute_import 9 8 10 from zope.interface.verify import verifyObject 9 11 10 12 from twisted.internet.base import BaseConnector … … 312 314 """ 313 315 Test routing of a message using the default route. 314 316 315 The default route is the one with C{None} as its key in the317 The default route is the one with L{None} as its key in the 316 318 routing table. It is taken when there is no more specific route 317 319 in the routing table that matches the stanza's destination. 318 320 """
Note: See TracBrowser
for help on using the repository browser.