ó Đ#…Mc@s2dZddlZddlZddlmZmZd„ZeƒZddlm Z ddl m Z ddl m Z ddlmZd efd „ƒYZd efd „ƒYZd efd„ƒYZd„Zy ejZWnek rýdd„ZnXd„Zdd„ZeZd„ZddgZdS(sL Plugin system for Twisted. @author: Jp Calderone @author: Glyph Lefkowitz i˙˙˙˙N(t Interfacet providedBycCs9yddl}|SWntk r4ddl}|SXdS(s5 Determine which 'pickle' API module to use. i˙˙˙˙N(tcPicklet ImportErrortpickle(RR((s2/usr/lib/python2.7/dist-packages/twisted/plugin.pyt_determinePickleModules    (tgetAdapterFactory(tnamedAny(tlog(t getModuletIPlugincBseZdZRS(sý Interface that must be implemented by all plugins. Only objects which implement this interface will be considered for return by C{getPlugins}. To be useful, plugins should also implement some other application-specific interface. (t__name__t __module__t__doc__(((s2/usr/lib/python2.7/dist-packages/twisted/plugin.pyR &st CachedPlugincBs8eZd„Zd„Zd„Zddd„ZeZRS(cCs;||_||_||_||_|jjj|ƒdS(N(tdropintnamet descriptiontprovidedtpluginstappend(tselfRRRR((s2/usr/lib/python2.7/dist-packages/twisted/plugin.pyt__init__2s     cCs<d|j|jjdjg|jD]}|j^q"ƒfS(Ns"s, (RRt moduleNametjoinRR (Rti((s2/usr/lib/python2.7/dist-packages/twisted/plugin.pyt__repr__9scCst|jjd|jƒS(Nt.(RRRR(R((s2/usr/lib/python2.7/dist-packages/twisted/plugin.pytload>scCs\xU|jD]J}|j|ƒr)|jƒSt||dƒdk r ||jƒ|ƒSq W|S(N(Rt isOrExtendsRRtNone(Rt interfacetregistrytdefaulttprovidedInterface((s2/usr/lib/python2.7/dist-packages/twisted/plugin.pyt __conform__As  N(R R RRRRR#t getComponent(((s2/usr/lib/python2.7/dist-packages/twisted/plugin.pyR1s     t CachedDropincBseZdZd„ZRS(s A collection of L{CachedPlugin} instances from a particular module in a plugin package. @type moduleName: C{str} @ivar moduleName: The fully qualified name of the plugin module this represents. @type description: C{str} or C{NoneType} @ivar description: A brief explanation of this collection of plugins (probably the plugin module's docstring). @type plugins: C{list} @ivar plugins: The L{CachedPlugin} instances which were loaded from this dropin. cCs||_||_g|_dS(N(RRR(RRR((s2/usr/lib/python2.7/dist-packages/twisted/plugin.pyR_s  (R R R R(((s2/usr/lib/python2.7/dist-packages/twisted/plugin.pyR%NscCsyt|j|jƒ}x]|jjƒD]L\}}t|dƒ}|dk r%t|||jtt |ƒƒƒq%q%W|S(N( R%R R t__dict__t iteritemsR RRtlistR(tproviderRtktvtplugin((s2/usr/lib/python2.7/dist-packages/twisted/plugin.pyt_generateCacheEntryfs   )cCs%i}x|D]}||| s,        H