Ticket #5831: implementer-application.patch

File implementer-application.patch, 4.1 KB (added by vperic, 4 years ago)
  • twisted/application/reactors.py

    diff --git twisted/application/reactors.py twisted/application/reactors.py
    index 203e3a5..6bae985 100644
    Plugin-based system for enumerating available reactors and installing one of 
    77them.
    88"""
    99
    10 from zope.interface import Interface, Attribute, implementer
     10from zope.interface import Interface, Attribute, implements
    1111
    1212from twisted.plugin import IPlugin, getPlugins
    1313from twisted.python.reflect import namedAny
    class NoSuchReactor(KeyError): 
    4141    """
    4242
    4343
    44 @implementer(IPlugin, IReactorInstaller)
    4544class Reactor(object):
    4645    """
    4746    @ivar moduleName: The fully-qualified Python name of the module of which
    4847    the install callable is an attribute.
    4948    """
     49    implements(IPlugin, IReactorInstaller)
    5050
    5151
    5252    def __init__(self, shortName, moduleName, description):
  • twisted/application/service.py

    diff --git twisted/application/service.py twisted/application/service.py
    index fb47943..66fef85 100644
    a sibling). 
    1313Maintainer: Moshe Zadka
    1414"""
    1515
    16 from zope.interface import implementer, Interface, Attribute
     16from zope.interface import implements, Interface, Attribute
    1717
    1818from twisted.python.reflect import namedAny
    1919from twisted.python import components
    class IServiceMaker(Interface): 
    5656
    5757
    5858
    59 @implementer(IPlugin, IServiceMaker)
    6059class ServiceMaker(object):
    6160    """
    6261    Utility class to simplify the definition of L{IServiceMaker} plugins.
    6362    """
     63    implements(IPlugin, IServiceMaker)
    6464
    6565    def __init__(self, name, module, description, tapname):
    6666        self.name = name
    class IService(Interface): 
    152152        """
    153153
    154154
    155 @implementer(IService)
    156155class Service:
    157156    """
    158157    Base class for services.
    class Service: 
    162161    as not serializing this book-keeping information.
    163162    """
    164163
     164    implements(IService)
     165
    165166    running = 0
    166167    name = None
    167168    parent = None
    class IServiceCollection(Interface): 
    253254
    254255
    255256
    256 @implementer(IServiceCollection)
    257257class MultiService(Service):
    258258    """
    259259    Straightforward Service Container.
    class MultiService(Service): 
    264264    will finish.
    265265    """
    266266
     267    implements(IServiceCollection)
     268
    267269    def __init__(self):
    268270        self.services = []
    269271        self.namedServices = {}
    class IProcess(Interface): 
    345347
    346348
    347349
    348 @implementer(IProcess)
    349350class Process:
    350351    """
    351352    Process running parameters.
    class Process: 
    353354    Sets up uid/gid in the constructor, and has a default
    354355    of C{None} as C{processName}.
    355356    """
     357    implements(IProcess)
    356358    processName = None
    357359
    358360    def __init__(self, uid=None, gid=None):
  • twisted/application/test/test_internet.py

    diff --git twisted/application/test/test_internet.py twisted/application/test/test_internet.py
    index 5ffc2a5..9e058d7 100644
    Tests for (new code in) L{twisted.application.internet}. 
    66"""
    77
    88
    9 from zope.interface import implementer
     9from zope.interface import implements
    1010from zope.interface.verify import verifyClass
    1111
    1212from twisted.internet.protocol import Factory
    from twisted.application.internet import StreamServerEndpointService 
    1515from twisted.internet.interfaces import IStreamServerEndpoint, IListeningPort
    1616from twisted.internet.defer import Deferred, CancelledError
    1717
    18 @implementer(IStreamServerEndpoint)
    1918class FakeServer(object):
    2019    """
    2120    In-memory implementation of L{IStreamServerEndpoint}.
    class FakeServer(object): 
    3736        returned from C{listen} before it is returned.
    3837    """
    3938
     39    implements(IStreamServerEndpoint)
     40
    4041    result = None
    4142    factory = None
    4243    failImmediately = None
    verifyClass(IStreamServerEndpoint, FakeServer) 
    8384
    8485
    8586
    86 @implementer(IListeningPort)
    8787class FakePort(object):
    8888    """
    8989    Fake L{IListeningPort} implementation.
    class FakePort(object): 
    9191    @ivar deferred: The L{Deferred} returned by C{stopListening}.
    9292    """
    9393
     94    implements(IListeningPort)
     95
    9496    deferred = None
    9597
    9698    def stopListening(self):