Ë
    òT•jS  ã                   ó2  — d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl	Z	d dl
mZmZmZ ddlmZmZ ddlmZ eej&                  ef   ZeZd„ Zeddee   defd	„«       Zd
ej&                  dee   fd„Zej4                  dee   dej&                  fd„«       Zej8                  dedej&                  fd„«       Zej8                  dddej&                  fd„«       Zd„ Zd
ej&                  fd„Zej@                  	 de jB                  dœd„«       Z"d„ Z#dede$fd„Z%ej4                  d„ «       Z&e&j9                  ejN                  «      ej@                  d„ «       «       Zej@                  dejP                  fd„«       Z)ej@                  d„ «       Z*d„ Z+y)é    N)ÚUnionÚOptionalÚcasté   )ÚResourceReaderÚTraversable)Ú	wrap_specc                 ó`   ‡ ‡— t        «       Št        j                  ‰ «      ‰‰fˆ ˆfd„	«       }|S )a  
    Replace 'package' parameter as 'anchor' and warn about the change.

    Other errors should fall through.

    >>> files('a', 'b')
    Traceback (most recent call last):
    TypeError: files() takes from 0 to 1 positional arguments but 2 were given
    c                 ó”   •— |‰ur1| ‰ur	 ‰| |«      S t        j                  dt        d¬«        ‰|«      S | ‰u r ‰«       S  ‰| «      S )Nz/First parameter to files is renamed to 'anchor'é   )Ú
stacklevel)ÚwarningsÚwarnÚDeprecationWarning)ÚanchorÚpackageÚfuncÚ	undefineds     €€ú2/usr/lib/python3.12/importlib/resources/_common.pyÚwrapperz"package_to_anchor.<locals>.wrapper!   sZ   ø€ à˜)Ñ#Ø˜YÑ&Ù˜F GÓ,Ð,Ü�M‰MØAÜ"Øõñ
 ˜“=Ð Ø�yÑ Ù“6ˆMÙ�F‹|Ðó    )ÚobjectÚ	functoolsÚwraps)r   r   r   s   ` @r   Úpackage_to_anchorr      s3   ù€ ô “€Iä‡_�_�TÓØ ¨)õ ó ðð €Nr   r   Úreturnc                 ó*   — t        t        | «      «      S )z3
    Get a Traversable resource for an anchor.
    )Úfrom_packageÚresolve)r   s    r   Úfilesr    3   s   € ô
 œ ›Ó(Ð(r   r   c                 ór   — | j                   }t        |j                  dd«      }|€y ||j                  «      S )z?
    Return the package's loader if it's a ResourceReader.
    Úget_resource_readerN)Ú__spec__ÚgetattrÚloaderÚname©r   ÚspecÚreaders      r   r"   r"   ;   s9   € ð ×Ñ€DÜ�T—[‘[Ð"7¸Ó>€FØ€~ØÙ�$—)‘)ÓÐr   Úcandc                 ó6   — t        t        j                  | «      S ©N)r   ÚtypesÚ
ModuleType©r*   s    r   r   r   K   s   € ä”× Ñ  $Ó'Ð'r   c                 ó,   — t        j                  | «      S r,   )Ú	importlibÚimport_moduler/   s    r   Ú_r3   P   s   € ä×"Ñ" 4Ó(Ð(r   c                 óB   — t        t        «       j                  d   «      S )NÚ__name__)r   Ú_infer_callerÚ	f_globalsr/   s    r   r3   r3   U   s   € ä”=“?×,Ñ,¨ZÑ8Ó9Ð9r   c                  ó´   — d„ } d„ }t        j                  | t        j                  «       «      }t        j                  ||«      }t	        |«      j
                  S )zS
    Walk the stack and find the frame of the first caller not in this module.
    c                 ó(   — | j                   t        k(  S r,   )ÚfilenameÚ__file__©Ú
frame_infos    r   Úis_this_filez#_infer_caller.<locals>.is_this_file_   s   € Ø×"Ñ"¤hÑ.Ð.r   c                 ó    — | j                   dk(  S )Nr   )Úfunctionr<   s    r   Ú
is_wrapperz!_infer_caller.<locals>.is_wrapperb   s   € Ø×"Ñ" iÑ/Ð/r   )Ú	itertoolsÚfilterfalseÚinspectÚstackÚnextÚframe)r>   rA   Únot_this_fileÚcallerss       r   r6   r6   Z   sH   € ò
/ò0ô ×)Ñ)¨,¼¿¹»ÓH€Mä×#Ñ# J°Ó>€GÜ�‹=×ÑÐr   c                 ó‚   — t        | «      }|j                  j                  |j                  «      }|j	                  «       S )z=
    Return a Traversable object for the given package.

    )r	   r%   r"   r&   r    r'   s      r   r   r   k   s2   € ô
 �WÓ€DØ�[‰[×,Ñ,¨T¯Y©YÓ7€FØ�<‰<‹>Ðr   )Ú
_os_removec             #   óp  K  — t        j                  |¬«      \  }}	 	 t        j                  | | «       «       t        j                  |«       ~ t        j                  |«      –— 	  ||«       y # t        j                  |«       w xY w# t        $ r Y y w xY w# 	  ||«       w # t        $ r Y w w xY wxY w­w©N)Úsuffix)ÚtempfileÚmkstempÚosÚwriteÚcloseÚpathlibÚPathÚFileNotFoundError)r)   rN   rK   ÚfdÚraw_paths        r   Ú	_tempfilerY   u   s    è ø€ ô ×#Ñ#¨6Ô2�L€Bˆðð	Ü�H‰H�R™›Ô"ä�H‰H�RŒLØÜ�l‰l˜8Ó$Ò$ð	Ù�xÕ øô �H‰H�R�Lûô !ò 	Ùð	ûð	Ù�xÕ øÜ ò 	Ùð	ÿso   ‚B6žA0 ¹-B Á'B
 Á/B6Á0BÂB Â
	BÂB6ÂBÂB6ÂB3ÂB$Â#B3Â$	B0Â-B3Â/B0Â0B3Â3B6c                 óD   — t        | j                  | j                  ¬«      S rM   )rY   Ú
read_bytesr&   ©Úpaths    r   Ú
_temp_filer^   �   s   € Ü�T—_‘_¨T¯Y©YÔ7Ð7r   r]   c                 ó€   — t        j                  t        «      5  | j                  «       cddd«       S # 1 sw Y   yxY w)a  
    Some Traversables implement ``is_dir()`` to raise an
    exception (i.e. ``FileNotFoundError``) when the
    directory doesn't exist. This function wraps that call
    to always return a boolean and only return True
    if there's a dir and it exists.
    NF)Ú
contextlibÚsuppressrV   Úis_dirr\   s    r   Ú_is_present_dirrc   ”   s4   € ô 
×	Ñ	Ô.Ó	/ñ Ø�{‰{‹}÷÷ ñ àús   š4´=c                 óD   — t        | «      rt        | «      S t        | «      S )zu
    Given a Traversable object, return that object as a
    path on the local file system in a context manager.
    )rc   Ú	_temp_dirr^   r\   s    r   Úas_filerf   ¡   s   € ô .¨dÔ3Œ9�T‹?ÐI¼ÀDÓ9IÐIr   c              #   ó   K  — | –— y­w)z7
    Degenerate behavior for pathlib.Path objects.
    N© r\   s    r   r3   r3   ª   s   è ø€ ð ƒJùs   ‚Údirc              #   óh   K  — | 5 }t        j                  |«      –— ddd«       y# 1 sw Y   yxY w­w)zD
    Wrap tempfile.TemporyDirectory to return a pathlib object.
    N)rT   rU   )ri   Úresults     r   Ú
_temp_pathrl   ³   s0   è ø€ ð
 
ð #�Ü�l‰l˜6Ó"Ò"÷#÷ #ñ #üs   ‚2…&�	2¦/«2c              #   ó°   K  — | j                  «       sJ ‚t        t        j                  «       «      5 }t	        || «      –— ddd«       y# 1 sw Y   yxY w­w)zt
    Given a traversable dir, recursively replicate the whole tree
    to the file system in a context manager.
    N)rb   rl   rO   ÚTemporaryDirectoryÚ_write_contents)r]   Útemp_dirs     r   re   re   ¼   sJ   è ø€ ð �;‰;Œ=Ðˆ=Ü	”H×/Ñ/Ó1Ó	2ð .°hÜ˜h¨Ó-Ò-÷.÷ .ñ .üs   ‚0A²A
Á	AÁ
AÁAc                 ó   — | j                  |j                  «      }|j                  «       r3|j                  «        |j	                  «       D ]  }t        ||«       Œ |S |j                  |j                  «       «       |S r,   )Újoinpathr&   rb   ÚmkdirÚiterdirro   Úwrite_bytesr[   )ÚtargetÚsourceÚchildÚitems       r   ro   ro   Ç   sk   € Ø�O‰O˜FŸK™KÓ(€EØ‡}�}„Ø�‰ŒØ—N‘NÓ$ò 	)ˆDÜ˜E 4Õ(ð	)ð €Lð 	×Ñ˜&×+Ñ+Ó-Ô.Ø€Lr   r,   )Ú ),rQ   rT   rO   r   r`   r-   r1   rD   r   rB   Útypingr   r   r   Úabcr   r   Ú	_adaptersr	   r.   ÚstrÚPackageÚAnchorr   r    r"   Úsingledispatchr   Úregisterr3   r6   r   ÚcontextmanagerÚremoverY   r^   Úboolrc   rf   rU   rn   rl   re   ro   rh   r   r   ú<module>r†      s  ðÛ 	Û Û Û Û Û Û Û Û Û ç (Ñ (ß ,å  à
�× Ñ  #Ð%Ñ
&€Ø	€òð< ñ)�(˜6Ñ"ð )¨kò )ó ð)ð ×!1Ñ!1ð °h¸~Ñ6Nó ð  ×Ñð(�(˜6Ñ"ð ( u×'7Ñ'7ò (ó ð(ð 	×Ñð)ˆCð )�E×$Ñ$ò )ó ð)ð 	×Ñð:ˆDð :�U×%Ñ%ò :ó ð:òð"˜%×*Ñ*ó ð ×Ñð ðð �y‰yóó ðò48ð
˜+ð 
¨$ó 
ð ×ÑñJó ðJð 	×Ñ�'—,‘,ÓØ×Ññó ó  ðð ×Ñð#�H×/Ñ/ò #ó ð#ð ×Ññ.ó ð.ór   