ó
    +K£j0  ã                   óÒ   • % S r SSKrSSKrSSKrSSKJr  SSKJr  SSK	J
r
  0 r\\\\   4   \S'   Sq\R"                  " 5       rS	 rS
 rS rS r " S S\
5      r " S S5      rS rg)z—This module implements a post import hook mechanism styled after what is
described in PEP-369. Note that it doesn't cope with modules being reloaded.

é    N)ÚCallable)Ú	find_specé   )ÚBaseObjectProxyÚ_post_import_hooksFc                 ó   ^ • U 4S jnU$ )Nc                 ó°   >• TR                  S5      u  pUR                  S5      n[        R                  " U5      nU H  n[        XE5      nM     U" U 5      $ )NÚ:Ú.)ÚsplitÚ	importlibÚimport_moduleÚgetattr)ÚmoduleÚmodule_nameÚfunctionÚattrsÚcallbackÚattrÚnames         €ÚœC:\Users\johnn\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\wrapt/importer.pyÚimport_hookÚ4_create_import_hook_from_string.<locals>.import_hook!   sR   ø€ Ø $§
¡
¨3£ÑˆØ—‘˜sÓ#ˆô ×*Ò*¨;Ó7ˆÛˆDÜ˜xÓ.ŠHñ á˜ÓÐó    © )r   r   s   ` r   Ú_create_import_hook_from_stringr       s   ø€ õ ð Ðr   c                 ó–  • [        U [        5      (       a  [        U 5      n [           [        (       d*  Sq[
        R                  R                  S[        5       5        [
        R                  R                  US5      nUc%  [        R                  U/ 5      R                  U 5        SSS5        Wb	  U " U5        gg! , (       d  f       N= f)a1  
Register a post import hook for the target module `name`. The `hook`
function will be called once the module is imported and will be passed the
module as argument. If the module is already imported, the `hook` will be
called immediately. If you also want to defer loading of the module containing
the `hook` function until required, you can specify the `hook` as a string in
the form 'module:function'. This will result in a proxy hook function being
registered which will defer loading of the specified module containing the
callback function until required.
Tr   N)Ú
isinstanceÚstrr   Ú_post_import_hooks_lockÚ_post_import_hooks_initÚsysÚ	meta_pathÚinsertÚImportHookFinderÚmodulesÚgetr   Ú
setdefaultÚappend)Úhookr   r   s      r   Úregister_post_import_hookr+   1   sœ   € ô �$œ×ÑÜ.¨tÓ4ˆæ	 ÷ 'Ò&Ø&*Ð#Ü�M‰M× Ñ  Ô$4Ó$6Ô7ô
 —‘—‘  tÓ,ˆà‰>Ü×)Ñ)¨$°Ó3×:Ñ:¸4Ô@÷! 
!ð. ÑÙˆV�ð ÷/ 
!Õ	 ús   §A>B:Â:
Cc                 ó  •  [         R                  R                  U S9nU H(  nUR                  5       n[        X2R                  5        M*     g! [         a1    [         R                  R                  5       R	                  U S5      n Nif = f)zÆ
Discover and register post import hooks defined as package entry points
in the specified `group`. The group should be a string that matches the
entry point group name used in the package metadata.
)Úgroupr   N)r   ÚmetadataÚentry_pointsÚ	TypeErrorr'   Úloadr+   r   )r-   ÚentrypointsÚ
entrypointr   s       r   Údiscover_post_import_hooksr4   a   sy   € ðGä×(Ñ(×5Ñ5¸EÐ5ÐBˆó
 "ˆ
Ø—?‘?Ó$ˆÜ! (¯O©OÖ<ò "øô	 ó Gä×(Ñ(×5Ñ5Ó7×;Ñ;¸EÀ2ÓFŠðGús   ‚A Á8B	ÂB	c                 ó¬   • [        U SS5      n[           [        R                  US5      nSSS5        W H  nU" U 5        M     g! , (       d  f       N = f)z¥
Notify that a `module` has been loaded and invoke any post import hooks
registered against the module. If the module is not registered, this
function does nothing.
Ú__name__Nr   )r   r    r   Úpop)r   r   Úhooksr*   s       r   Únotify_module_loadedr9   z   sH   € ô �6˜: tÓ,€Dæ	 Ü"×&Ñ& t¨RÓ0ˆ÷ 
!ó ˆÙˆVŽò ÷ 
!Õ	 ús   ”AÁ
Ac                   ó@   ^ • \ rS rSrU 4S jrS rS rS rS rSr	U =r
$ )Ú_ImportHookChainedLoaderé”   c                 ó<  >• [         [        U ]  U5        [        US5      (       a  U R	                  SU R
                  5        [        US5      (       a  U R	                  SU R                  5        [        US5      (       a  U R	                  SU R                  5        g g )NÚload_moduleÚcreate_moduleÚexec_module)Úsuperr;   Ú__init__ÚhasattrÚ__self_setattr__Ú_self_load_moduleÚ_self_create_moduleÚ_self_exec_module)ÚselfÚloaderÚ	__class__s     €r   rB   Ú!_ImportHookChainedLoader.__init__–   sƒ   ø€ ô 	Ô&¨Ñ6°vÔ>ä�6˜=×)Ñ)Ø×!Ñ! -°×1GÑ1GÔHÜ�6˜?×+Ñ+Ø×!Ñ! /°4×3KÑ3KÔLÜ�6˜=×)Ñ)Ø×!Ñ! -°×1GÑ1GÕHð *r   c                 ó  •  " S S5      n[        USU5      S U 4;   a   U R                  Ul        [        USS 5      b7  [        UR                  SS 5      U L a  U R                  UR                  l        g g g ! [         a     NRf = f)Nc                   ó   • \ rS rSrSrg)Ú<_ImportHookChainedLoader._self_set_loader.<locals>.UNDEFINEDé¯   r   N)r6   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__static_attributes__r   r   r   Ú	UNDEFINEDrN   ¯   s   † Úr   rT   Ú
__loader__Ú__spec__rI   )r   Ú__wrapped__rU   ÚAttributeErrorrV   rI   )rH   r   rT   s      r   Ú_self_set_loaderÚ)_ImportHookChainedLoader._self_set_loader£   s�   € ÷	ñ 	ô �6˜<¨Ó3¸¸d°|ÓCðØ$(×$4Ñ$4�Ô!ô
 �F˜J¨Ó-Ñ9Ü˜Ÿ™¨°4Ó8¸DÒ@à%)×%5Ñ%5ˆF�O‰OÕ"ð Að :øô	 "ó Ùðús   ŸA6 Á6
BÂBc                 ót   • U R                   R                  U5      nU R                  U5        [        U5        U$ ©N)rW   r>   rY   r9   )rH   Úfullnamer   s      r   rE   Ú*_ImportHookChainedLoader._self_load_module¾   s3   € Ø×!Ñ!×-Ñ-¨hÓ7ˆØ×Ñ˜fÔ%Ü˜VÔ$àˆr   c                 ó8   • U R                   R                  U5      $ r\   )rW   r?   )rH   Úspecs     r   rF   Ú,_ImportHookChainedLoader._self_create_moduleÈ   s   € Ø×Ñ×-Ñ-¨dÓ3Ð3r   c                 ór   • U R                  U5        U R                  R                  U5        [        U5        g r\   )rY   rW   r@   r9   )rH   r   s     r   rG   Ú*_ImportHookChainedLoader._self_exec_moduleË   s,   € Ø×Ñ˜fÔ%Ø×Ñ×$Ñ$ VÔ,Ü˜VÕ$r   r   )r6   rP   rQ   rR   rB   rY   rE   rF   rG   rS   Ú__classcell__)rJ   s   @r   r;   r;   ”   s"   ø† õIò6ò6ò4÷%ð %r   r;   c                   ó.   • \ rS rSrS rSS jrSS jrSrg)	r%   éÑ   c                 ó   • 0 U l         g r\   ©Úin_progress)rH   s    r   rB   ÚImportHookFinder.__init__Ó   s
   € ØˆÕr   Nc                 ó�  • [            U[        ;  a
   S S S 5        g XR                  ;   a
   S S S 5        g SU R                  U'   S S S 5         [        [	        U5      SS 5      nU(       a-  [        U[        5      (       d  [        U5      U R                  U	 $ U R                  U	 g ! , (       d  f       Ng= f! U R                  U	 f = f©NTrI   )r    r   ri   r   r   r   r;   )rH   r]   ÚpathrI   s       r   Úfind_moduleÚImportHookFinder.find_moduleÖ   s¶   € Þ$ð
 Ô1Ó1Ø÷ %Ð$ð ×+Ñ+Ó+Ø÷! %Ð$ð$ *.ˆD×Ñ˜XÑ&÷% %ð,	+ô œY xÓ0°(¸DÓAˆFæœj¨Ô1I×JÑJÜ/°Ó7ð × Ñ  Ñ*�× Ñ  Ñ*÷K %Õ$ûðJ × Ñ  Ñ*ús!   ‡B%œB%µB%Á<B6 Â%
B3Â6Cc                 ó†  • [            U[        ;  a
   S S S 5        g XR                  ;   a
   S S S 5        g SU R                  U'   S S S 5         [        U5      n[	        USS 5      nU(       a%  [        U[        5      (       d  [        U5      Ul        UU R                  U	 $ ! , (       d  f       Nb= f! U R                  U	 f = frl   )r    r   ri   r   r   r   r;   rI   )rH   r]   rm   Útargetr`   rI   s         r   r   ÚImportHookFinder.find_specþ   s·   € ö
 %ð
 Ô1Ó1Ø÷ %Ð$ð ×+Ñ+Ó+Ø÷! %Ð$ð$ *.ˆD×Ñ˜XÑ&÷% %ð,	+ô ˜XÓ&ˆDÜ˜T 8¨TÓ2ˆFæœj¨Ô1I×JÑJÜ6°vÓ>�”àð × Ñ  Ñ*÷G %Õ$ûðF × Ñ  Ñ*ús"   ‡B œB µB ÁAB1 Â 
B.Â1C rh   r\   )NN)r6   rP   rQ   rR   rB   rn   r   rS   r   r   r   r%   r%   Ñ   s   † òô&+÷P(+r   r%   c                 ó   ^ • U 4S jnU$ )a=  
Returns a decorator that registers the decorated function as a post import
hook for the module specified by `name`. The function will be called once
the module with the specified name is imported, and will be passed the
module as argument. If the module is already imported, the function will
be called immediately.
c                 ó    >• [        U T5        U $ r\   )r+   )r*   r   s    €r   ÚregisterÚwhen_imported.<locals>.register6  s   ø€ Ü! $¨Ô-Øˆr   r   )r   ru   s   ` r   Úwhen_importedrw   -  s   ø€ õð €Or   )Ú__doc__Úimportlib.metadatar   r"   Ú	threadingÚcollections.abcr   Úimportlib.utilr   Ú	__wrapt__r   r   Údictr   ÚlistÚ__annotations__r!   ÚRLockr    r   r+   r4   r9   r;   r%   rw   r   r   r   Ú<module>r‚      s€   ðòó
 Û 
Û Ý $Ý $å &ð 13Ð �D˜˜d 8™nÐ,Ñ-Ó 2ØÐ Ø#Ÿ/š/Ó+Ð òò"*ò`=ò2ô4:%˜ô :%÷zU+ñ U+óxr   