ó
    Ö›‘h!  ã                   óŠ  • S r SSKrSSKrSSKrSSKrSSKJrJrJrJ	r	  SSK
JrJr  SSKJr  SSKJr  SSKJr  SSKJr   " S	 S
\5      r " S S5      r " S S5      rS r \R4                  rS rS\R:                  4S jr\	" S\S9r SS\\   S\\R:                     S\\   4S jjr \ r!S r"SS/r#g! \ a    SS jr NSf = f)zL
Plugin system for Twisted.

@author: Jp Calderone
@author: Glyph Lefkowitz
é    N)ÚIterableÚOptionalÚTypeÚTypeVar)Ú	InterfaceÚ
providedBy)Úlog)ÚgetAdapterFactory)Ú	getModule)ÚnamedAnyc                   ó   • \ rS rSrSrSrg)ÚIPluginé   zé
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.
© N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__static_attributes__r   ó    ÚRC:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\twisted/plugin.pyr   r      s   † ôr   r   c                   ó<   • \ rS rSrS rS\4S jrS rS	S jr\r	Sr
g)
ÚCachedPluginé&   c                 ó~   • Xl         X l        X0l        X@l        U R                   R                  R                  U 5        g ©N)ÚdropinÚnameÚdescriptionÚprovidedÚpluginsÚappend)Úselfr   r   r    r!   s        r   Ú__init__ÚCachedPlugin.__init__'   s/   € ØŒØŒ	Ø&ÔØ ŒØ�‰×Ñ×"Ñ" 4Õ(r   Úreturnc           
      óÔ   • SR                  U R                  U R                  R                  SR	                  U R
                   Vs/ s H  oR                  PM     sn5      5      $ s  snf )Nz(<CachedPlugin {!r}/{!r} (provides {!r})>z, )Úformatr   r   Ú
moduleNameÚjoinr!   r   )r$   Úis     r   Ú__repr__ÚCachedPlugin.__repr__.   sO   € Ø9×@Ñ@Ø�I‰IØ�K‰K×"Ñ"Ø�I‰I¨4¯=ª=Ó9ª= a—z”z©=Ñ9Ó:ó
ð 	
ùò :s   ÁA%c                 ó`   • [        U R                  R                  S-   U R                  -   5      $ )NÚ.)r   r   r*   r   )r$   s    r   ÚloadÚCachedPlugin.load5   s%   € Ü˜Ÿ™×.Ñ.°Ñ4°t·y±yÑ@ÓAÐAr   Nc                 óÈ   • U R                    HQ  nUR                  U5      (       a  U R                  5       s  $ [        XAS 5      c  M:  U" U R                  5       U5      s  $    U$ r   )r!   ÚisOrExtendsr1   r
   )r$   Ú	interfaceÚregistryÚdefaultÚprovidedInterfaces        r   Ú__conform__ÚCachedPlugin.__conform__8   sV   € Ø!%§¤ÐØ ×,Ñ,¨Y×7Ñ7Ø—y‘y“{Ò"Ü Ð!2¸tÓDÓPÙ  §¡£¨gÓ6Ò6ñ	 "/ð
 ˆr   )r    r   r   r!   )NN)r   r   r   r   r%   Ústrr-   r1   r9   ÚgetComponentr   r   r   r   r   r   &   s%   † ò)ð
˜#ô 
òBôð ƒLr   r   c                   ó   • \ rS rSrSrS rSrg)ÚCachedDropinéD   aÎ  
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 L{None}
@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.
c                 ó*   • Xl         X l        / U l        g r   )r*   r    r"   )r$   r*   r    s      r   r%   ÚCachedDropin.__init__V   s   € Ø$ŒØ&ÔØˆ�r   )r    r*   r"   N)r   r   r   r   r   r%   r   r   r   r   r>   r>   D   s   † ñõ"r   r>   c                 ó   • [        U R                  U R                  5      nU R                  R	                  5        H?  u  p#[        US 5      nUc  M  [        XUR                  [        [        U5      5      5        MA     U$ r   )	r>   r   r   Ú__dict__Úitemsr   r   Úlistr   )Úproviderr   ÚkÚvÚplugins        r   Ú_generateCacheEntryrJ   \   sh   € Ü˜(×+Ñ+¨X×-=Ñ-=Ó>€FØ×!Ñ!×'Ñ'Ö)‰ˆÜ˜˜DÓ!ˆØÓä˜ A§I¡I¬t´J¸vÓ4FÓ/GÖHñ	 *ð
 €Mr   c                 ó$   • 0 nU  H  nXU'   M	     U$ r   r   )ÚkeysÚvalueÚdrG   s       r   ÚfromkeysrO   j   s   € ØˆÛˆAØˆa‹Dñ àˆr   c                 óÐ  • 0 n[        U R                  5      n0 nUR                  5        H;  nUR                  R	                  5       nXS;  a  / X5'   X5   nUR                  U5        M=     UR                  5        GH8  u  pvUR                  S5      n UR                  5       n	UR                  S5       n
[        R                  " U
5      nSSS5        Sn0 nU Hm  nUR                  R                  S5      S   nSXß'   UW;  d   UR                  R                  5       U	:¼  d  MK  Sn UR                  5       n[        U5      nUX¿'   Mo     [%        WR'                  5       5       H  nXý;  d  M
  X¿	 SnM     U(       a&   UR)                  [        R*                  " U5      5        UR5                  U5        GM;     U$ ! , (       d  f       Nõ= f! [         a    0 nSn	 GN	f = f! [         a    [         R"                  " 5          GM*  f = f! [,         a4  n[         R.                  " S	UR0                  UR2                  S
9   SnANžSnAf[         a    [         R"                  " SS5         NÄf = f)a#  
Compute all the possible loadable plugins, while loading as few as
possible and hitting the filesystem as little as possible.

@param module: a Python module object.  This represents a package to search
for plugins.

@return: a dictionary mapping module names to L{CachedDropin} instances.
zdropin.cacheÚrNr   Fr0   éÿÿÿÿTz@Unable to write to plugin cache %(path)s: error number %(errno)d)r)   ÚpathÚerrnoz)Unexpected error while writing cache file)r   r   ÚiterModulesÚfilePathÚparentr#   rD   ÚchildÚgetModificationTimeÚopenÚpickler1   ÚBaseExceptionr   ÚsplitrJ   r	   ÚerrrE   rL   Ú
setContentÚdumpsÚOSErrorÚmsgrS   rT   Úupdate)ÚmoduleÚallCachesCombinedÚmodÚbucketsÚplugmodÚfppÚbucketÚpseudoPackagePathÚ
dropinPathÚ
lastCachedÚfÚdropinDotCacheÚ
needsWriteÚexistingKeysÚpluginModuleÚ	pluginKeyrF   ÚentryÚes                      r   ÚgetCacherv   q   s2  € ð ÐÜ
�F—O‘OÓ
$€Cà€Gð —?‘?Ö$ˆØ×Ñ×%Ñ%Ó'ˆØÓØˆG‰LØ‘ˆØ�‰�gÖñ %ð &-§]¡]§_Ñ!ÐØ&×,Ñ,¨^Ó<ˆ
ð	Ø#×7Ñ7Ó9ˆJØ—‘ Ô%¨Ü!'§¢¨Q£�÷ &ð ˆ
ØˆÛ"ˆLØ$×)Ñ)×/Ñ/°Ó4°RÑ8ˆIØ&*ˆLÑ#Ø Ó/Ø×%Ñ%×9Ñ9Ó;¸zÕIà!�
ð6Ø+×0Ñ0Ó2�Hô
 0°Ó9�EØ05�NÓ-ñ #ô  ˜n×1Ñ1Ó3Ö4ˆIØÕ,Ø"Ð-Ø!’
ñ 5ö ðKØ×%Ñ%¤f§l¢l°>Ó&BÔCð 	× Ñ  ×0ñ] &5ð^ Ð÷W &Õ%ûäó 	ØˆNØ‹Jð	ûô %ó ä—G’G—I�Iðûô ó Ü—’ð+ð $Ÿ™ØŸ'™'÷ûô !ó KÜ—’˜ÐIÖJðKús`   Â!G	Â2F8Ã	G	Ä%GÅ;%HÆ8
G	ÇG	ÇG	Ç	GÇGÇHÈHÈ
I%È*H>È>$I%É$I%r'   c                  ó   • SS K Jn   U $ )Nr   )Útwisted.pluginsr"   )Úpackages    r   Ú_pluginsPackagerz   ½   s
   € Ý%à€Nr   Ú_TInterface)Úboundr5   ry   c              #   ó  #   • Uc
  [        5       n[        U5      nUR                  5        H+  u  p4UR                   H  n U " US5      nUb  Uv •  M  M     M-     g! [         a    [
        R                  " 5          MA  f = f7f)aG  
Retrieve all plugins implementing the given interface beneath the given module.

@param interface: An interface class.  Only plugins which implement this
interface will be returned.

@param package: A package beneath which plugins are installed.  For
most uses, the default value is correct.

@return: An iterator of plugins.
N)rz   rv   rD   r"   r\   r	   r^   )r5   ry   Ú
allDropinsÚkeyr   rI   Úadapteds          r   Ú
getPluginsr�   Æ   s}   é € ð �Ü!Ó#ˆÜ˜'Ó"€JØ!×'Ñ'Ö)‰ˆØ—n”nˆFð"Ù# F¨DÓ1�ð Ñ&Ø!”Mñ 'ó %ò *øô !ó Ü—’—	ðüs)   ‚=BÁ 	AÁ	BÁA>Á:BÁ=A>Á>Bc           
      óz  • U R                  S5      n[        R                   Vs/ s HŠ  n[        R                  R	                  [        R                  R
                  " U/US/-   Q76 5      (       a  ML  [        R                  R                  [        R                  R
                  " U/UQ76 5      PMŒ     sn$ s  snf )a„  
Return a list of additional directories which should be searched for
modules to be included as part of the named plugin package.

@type name: C{str}
@param name: The fully-qualified Python name of a plugin package, eg
    C{'twisted.plugins'}.

@rtype: C{list} of C{str}
@return: The absolute paths to other directories which may contain plugin
    modules for the named plugin package.
r0   z__init__.py)r]   ÚsysrS   ÚosÚexistsr+   Úabspath)r   ry   Úxs      r   ÚpluginPackagePathsrˆ   æ   s†   € ð �j‰j˜‹o€Gô —’óâˆAÜ�w‰w�~‰~œbŸg™gŸlšl¨1ÐI¨w¸-¸Ñ/HÒI×Jó 	3Œ�‰�‰œŸ™Ÿš QÐ1¨Ò1Ö2Ùñð ùò s   ¤AB8Á3AB8r�   rˆ   r   )$r   r„   r[   rƒ   ÚtypesÚtypingr   r   r   r   Úzope.interfacer   r   Útwisted.pythonr	   Útwisted.python.componentsr
   Útwisted.python.modulesr   Útwisted.python.reflectr   r   r   r>   rJ   ÚdictrO   ÚAttributeErrorrv   Ú
ModuleTyperz   r{   r�   Ú
getPlugInsrˆ   Ú__all__r   r   r   Ú<module>r•      sð   ðñó 
Û Û 
Û ß 4Ó 4ç 0å Ý 7Ý ,Ý +ôˆiô ÷ñ ÷<ñ ò0ðØ�}‰}€HòIðX˜×)Ñ)ô ñ �m¨9Ñ5€ð IMñ"Ø�KÑ ð"Ø+3°E×4DÑ4DÑ+Eð"àˆkÑõ"ð: €
òð< Ð-Ð
.�øðy ó öðús   Á"B4 Â4CÃC