[Twisted-Python] Plugin startup and shutdown actions

glyph at divmod.com glyph at divmod.com
Sat Apr 11 20:23:14 EDT 2009

On 11 Apr, 08:39 pm, exarkun at divmod.com wrote:
>On Sat, 11 Apr 2009 21:54:08 +0200, Esteve Fernandez 
><esteve at sindominio.net> wrote:

>>Shouldn't twisted and twisted/plugins be non-importable? I thought 
>>twisted and
>>twisted/plugins must not have __init__.py files in order for the 
>>system to be able to find them (through getPlugins). Or did that 
>>change in recent versions?
>They must not have __init__.py files, indeed.  However, the files in
>twisted/plugins/ still define sub-modules of the twisted.plugins 
>due to the code in Twisted's twisted/plugins/__init__.py.

They must not have __init__.py files specifically to avoid *conflicting* 
with this Twisted's twisted/plugins/__init__.py.  Since the idea is 
that, during installation, your foo_plugin.py will go into the site's 
twisted/plugins directory, we forbid projects to make twisted/plugins a 
package because otherwise one package would stomp over the other's 
__init__.py and break things.

More information about the Twisted-Python mailing list