[Twisted-Python] How to configure setup.py for a twistd TAP app

Chris Miles miles.chris at gmail.com
Thu Dec 20 23:43:26 MST 2007


On 21/12/2007, at 1:30 AM, Jean-Paul Calderone wrote:

> On Thu, 20 Dec 2007 18:23:44 +1100, Chris Miles  
> <miles.chris at gmail.com> wrote:
>> Thanks Jean-Paul, that worked great, with both  
>> distutils.core.setup  and twisted.python.dist.setup.  When I used  
>> the latter I didn't need  to regenerate the plugin cache, twistd  
>> picked up the new command  immediately after install.  Is this the  
>> advantage of  twisted.python.dist.setup ?
>
> Not quite.  twisted.python.dist is an internal module, not part of  
> Twisted's
> public API.  Notice this line in its docstring:
>
>   API Stability: Unstable. Don't use it outside of Twisted.

Understood.  I'm happy with the solution using distutils.core.setup  
and forcing a plugin cache refresh.

btw, the "Plugin Caching" section on http://twistedmatrix.com/projects/core/documentation/howto/plugin.html#auto3 
  has an error.  The sample code uses "getPlugin" but it should be  
getPlugins.

i.e. I needed to use (with Twisted 2.5.0):
{{{
from twisted.plugin import IPlugin, getPlugins
list(getPlugins(IPlugin))
}}}

Cheers,
Chris Miles





More information about the Twisted-Python mailing list