Ignore:
Timestamp:
Jan 22, 2012, 2:51:25 PM (10 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
default
Message:

Cleanups leading up to Wokkel 0.7.0.

As we now depend on Twisted 10.0.0 or higher, the following classes and
interfaces were deprecated:

This also resolves all Pyflakes warnings, changes links for www.xmpp.org to
xmpp.org and fixes the copyright notice in LICENSE to include 2012.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wokkel/iwokkel.py

    r160 r165  
     1# -*- test-case-name: wokkel.test.test_iwokkel -*-
     2#
    13# Copyright (c) Ralph Meijer.
    24# See LICENSE for details.
     
    68"""
    79
    8 from zope.interface import Attribute, Interface
    9 
    10 class IXMPPHandler(Interface):
    11     """
    12     Interface for XMPP protocol handlers.
    13 
    14     Objects that provide this interface can be added to a stream manager to
    15     handle of (part of) an XMPP extension protocol.
    16     """
    17 
    18     parent = Attribute("""XML stream manager for this handler""")
    19     xmlstream = Attribute("""The managed XML stream""")
    20 
    21     def setHandlerParent(parent):
    22         """
    23         Set the parent of the handler.
    24 
    25         @type parent: L{IXMPPHandlerCollection}
    26         """
    27 
    28 
    29     def disownHandlerParent(parent):
    30         """
    31         Remove the parent of the handler.
    32 
    33         @type parent: L{IXMPPHandlerCollection}
    34         """
    35 
    36 
    37     def makeConnection(xs):
    38         """
    39         A connection over the underlying transport of the XML stream has been
    40         established.
    41 
    42         At this point, no traffic has been exchanged over the XML stream
    43         given in C{xs}.
    44 
    45         This should setup L{xmlstream} and call L{connectionMade}.
    46 
    47         @type xs: L{XmlStream<twisted.words.protocols.jabber.XmlStream>}
    48         """
    49 
    50 
    51     def connectionMade():
    52         """
    53         Called after a connection has been established.
    54 
    55         This method can be used to change properties of the XML Stream, its
    56         authenticator or the stream manager prior to stream initialization
    57         (including authentication).
    58         """
    59 
    60 
    61     def connectionInitialized():
    62         """
    63         The XML stream has been initialized.
    64 
    65         At this point, authentication was successful, and XML stanzas can be
    66         exchanged over the XML stream L{xmlstream}. This method can be
    67         used to setup observers for incoming stanzas.
    68         """
    69 
    70 
    71     def connectionLost(reason):
    72         """
    73         The XML stream has been closed.
    74 
    75         Subsequent use of L{parent.send} will result in data being queued
    76         until a new connection has been established.
    77 
    78         @type reason: L{twisted.python.failure.Failure}
    79         """
    80 
    81 
    82 
    83 class IXMPPHandlerCollection(Interface):
    84     """
    85     Collection of handlers.
    86 
    87     Contain several handlers and manage their connection.
    88     """
    89 
    90     def __iter__():
    91         """
    92         Get an iterator over all child handlers.
    93         """
    94 
    95 
    96     def addHandler(handler):
    97         """
    98         Add a child handler.
    99 
    100         @type handler: L{IXMPPHandler}
    101         """
    102 
    103 
    104     def removeHandler(handler):
    105         """
    106         Remove a child handler.
    107 
    108         @type handler: L{IXMPPHandler}
    109         """
    110 
     10__all__ = ['IXMPPHandler', 'IXMPPHandlerCollection',
     11           'IPubSubClient', 'IPubSubService', 'IPubSubResource',
     12           'IMUCClient', 'IMUCStatuses']
     13
     14from zope.interface import Interface
     15from twisted.python.deprecate import deprecatedModuleAttribute
     16from twisted.python.versions import Version
     17from twisted.words.protocols.jabber.ijabber import IXMPPHandler
     18from twisted.words.protocols.jabber.ijabber import IXMPPHandlerCollection
     19
     20deprecatedModuleAttribute(
     21        Version("Wokkel", 0, 7, 0),
     22        "Use twisted.words.protocols.jabber.ijabber.IXMPPHandler instead.",
     23        __name__,
     24        "IXMPPHandler")
     25
     26deprecatedModuleAttribute(
     27        Version("Wokkel", 0, 7, 0),
     28        "Use twisted.words.protocols.jabber.ijabber.IXMPPHandlerCollection "
     29                "instead.",
     30        __name__,
     31        "IXMPPHandlerCollection")
    11132
    11233
     
    14364        @type nodeIdentifier: C{unicode}
    14465        """
     66
    14567
    14668
     
    250172        @rtype: L{defer.Deferred}
    251173        """
     174
    252175
    253176
     
    1029952
    1030953
     954
    1031955class IMUCStatuses(Interface):
    1032956    """
Note: See TracChangeset for help on using the changeset viewer.