Ticket #4676 enhancement closed duplicate

Opened 4 years ago

Last modified 4 years ago

There's no api for setting components in a twistd plugin

Reported by: djfroofy Owned by:
Priority: normal Milestone:
Component: core Keywords:
Cc: Branch:
Author: Launchpad Bug:

Description

Currently there's no api for setting the components in a twistd plugin. In .tac files, this is trivial:

application.setComponent(ILogObserver, PythonLoggingObserver().emit)

The only way I know how to do this is inheriting from MultiService:

class PythonLoggingMultiService(service.MultiService):

    def setServiceParent(self, parent):
        super(PythonLoggingMultiService, self).setServiceParent(parent)
        parent.setComponent(ILogObserver, PythonLoggingObserver().emit) 

twistd plugins:  http://twistedmatrix.com/documents/current/core/howto/tap.html

Change History

1

Changed 4 years ago by exarkun

  • status changed from new to closed
  • resolution set to duplicate

This is a duplicate of #638.

2

Changed 3 years ago by <automation>

  • owner glyph deleted
Note: See TracTickets for help on using tickets.