[Twisted-Python] Twisted Plugins that for classes that implement interfaces

Paul Wilson paulalexwilson at gmail.com
Mon Sep 22 08:45:31 EDT 2008


2008/9/22 Phil Christensen <phil at bubblehouse.org>:
> On Sep 22, 2008, at 4:37 AM, Paul Wilson wrote:
>>
>> Hi all,
>>
>> I'd like to be able to use the twisted plugin mechanism to extract
>> classes that implement given interfaces. I've successfully followed
>> the examples to get an iterator over _objects_ that provide my
>> interfaces, but can't find a way to get just the classes.
>>
>> Does such a facility exist or am I going to need a rethink? Thanks in
>> advance...
>
> Hi Paul,
>
> Try using classProvides() instead of implements() in your class definition.
> That should result in the plugin system returning the class itself, instead
> of the instance.
>
> -phil
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>

Brilliant. Thank's fixed it!




More information about the Twisted-Python mailing list