[Twisted-Python] Plugin startup and shutdown actions
terry at jon.es
Sat Apr 11 13:48:38 EDT 2009
>>>>> "luper" == luper rouch <luper.rouch at gmail.com> writes:
luper> I have a last question, I put my plugins in a 'twisted/plugins'
luper> subfolder of my project, and running them from the command line
luper> works fine. How can I invoke them in unit tests (I need to be able
luper> to start and stop them), since the plugin files are not in a
I suspect some will answer "Uh, you probably shouldn't be doing that"...
But something like this will work:
from twisted.plugin import getPlugins
from twisted.application.service import IServiceMaker
for plugin in getPlugins(IServiceMaker):
if hasattr(plugin, 'tapname'):
if plugin.tapname == name:
More information about the Twisted-Python