Ë
    òT•j‚  ã                   ór   — d dl mZ d dlmZ ddlmZ  G d„ d«      Z G d„ d«      Zdd	„Z G d
„ d«      Z	d„ Z
y)é    )Úsuppress)ÚTextIOWrapperé   )Úabcc                   ó"   — e Zd ZdZd„ fd„Zd„ Zy)ÚSpecLoaderAdapterz>
    Adapt a package spec to adapt the underlying loader.
    c                 ó   — | j                   S ©N)Úloader©Úspecs    ú4/usr/lib/python3.12/importlib/resources/_adapters.pyú<lambda>zSpecLoaderAdapter.<lambda>   s
   € °$·+±+€ ó    c                 ó,   — || _          ||«      | _        y r
   )r   r   )Úselfr   Úadapters      r   Ú__init__zSpecLoaderAdapter.__init__   s   € ØˆŒ	Ù˜d“mˆ�r   c                 ó.   — t        | j                  |«      S r
   )Úgetattrr   ©r   Únames     r   Ú__getattr__zSpecLoaderAdapter.__getattr__   s   € Ü�t—y‘y $Ó'Ð'r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   © r   r   r   r      s   „ ññ &>ó $ó(r   r   c                   ó   — e Zd ZdZd„ Zd„ Zy)ÚTraversableResourcesLoaderz9
    Adapt a loader to provide TraversableResources.
    c                 ó   — || _         y r
   r   ©r   r   s     r   r   z#TraversableResourcesLoader.__init__   ó	   € Øˆ�	r   c                 óH   — t        | j                  «      j                  «       S r
   )ÚCompatibilityFilesr   Ú_nativer   s     r   Úget_resource_readerz.TraversableResourcesLoader.get_resource_reader   s   € Ü! $§)¡)Ó,×4Ñ4Ó6Ð6r   N)r   r   r   r   r   r'   r   r   r   r    r       s   „ ñòó7r   r    c                 óV   — |dk(  rt        | g|¢­i |¤ŽS |dk(  r| S t        d|› d�«      ‚)NÚrÚrbzInvalid mode value 'z"', only 'r' and 'rb' are supported)r   Ú
ValueError)ÚfileÚmodeÚargsÚkwargss       r   Ú_io_wrapperr0       s@   € Øˆs‚{Ü˜TÐ3 DÒ3¨FÑ3Ð3Ø	�ŠØˆÜ
Ð+¨D¨6Ð1SÐTÓ
UÐUr   c                   ó¶   — e Zd ZdZ G d„ dej
                  «      Z G d„ dej
                  «      Z G d„ dej
                  «      Zd„ Z	e
d	„ «       Zd
„ Zd„ Zd„ Zy)r%   zj
    Adapter for an existing or non-existent resource reader
    to provide a compatibility .files().
    c                   óD   — e Zd ZdZd„ Zd„ Zd„ ZeZd„ Ze	d„ «       Z
d	d„Zy)
úCompatibilityFiles.SpecPathzk
        Path tied to a module spec.
        Can be read and exposes the resource reader children.
        c                 ó    — || _         || _        y r
   )Ú_specÚ_reader)r   r   Úreaders      r   r   z$CompatibilityFiles.SpecPath.__init__4   s   € ØˆDŒJØ!ˆD�Lr   c                 óŠ   ‡ — ‰ j                   st        d«      S t        ˆ fd„‰ j                   j                  «       D «       «      S )Nr   c              3   ó^   •K  — | ]$  }t         j                  ‰j                  |«      –— Œ& y ­wr
   )r%   Ú	ChildPathr6   )Ú.0Úpathr   s     €r   ú	<genexpr>z6CompatibilityFiles.SpecPath.iterdir.<locals>.<genexpr>;   s*   øè ø€ ò àô #×,Ñ,¨T¯\©\¸4×@ñùs   ƒ*-)r6   ÚiterÚcontents©r   s   `r   Úiterdirz#CompatibilityFiles.SpecPath.iterdir8   s:   ø€ Ø—<’<Ü˜B“x�Üó à ŸL™L×1Ñ1Ó3ôó ð r   c                  ó   — y©NFr   r@   s    r   Úis_filez#CompatibilityFiles.SpecPath.is_file@   ó   € Ør   c                 ó„   — | j                   st        j                  |«      S t        j                  | j                   |«      S r
   )r6   r%   Ú
OrphanPathr:   ©r   Úothers     r   Újoinpathz$CompatibilityFiles.SpecPath.joinpathE   s1   € Ø—<’<Ü)×4Ñ4°UÓ;Ð;Ü%×/Ñ/°·±¸eÓDÐDr   c                 ó.   — | j                   j                  S r
   )r5   r   r@   s    r   r   z CompatibilityFiles.SpecPath.nameJ   s   € à—:‘:—?‘?Ð"r   c                 óT   — t        | j                  j                  d «      |g|¢­i |¤ŽS r
   )r0   r6   Úopen_resource©r   r-   r.   r/   s       r   Úopenz CompatibilityFiles.SpecPath.openN   s)   € Ü˜tŸ|™|×9Ñ9¸$Ó?ÀÐWÈÒWÐPVÑWÐWr   N©r)   ©r   r   r   r   r   rA   rD   Úis_dirrJ   Úpropertyr   rO   r   r   r   ÚSpecPathr3   .   s=   „ ñ	ò
	"ò	ò	ð ˆò	Eð
 
ñ	#ó 
ð	#ô	Xr   rT   c                   óF   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Ze	d„ «       Z
d
d„Zy	)úCompatibilityFiles.ChildPathzw
        Path tied to a resource reader child.
        Can be read but doesn't expose any meaningful children.
        c                 ó    — || _         || _        y r
   )r6   Ú_name)r   r7   r   s      r   r   z%CompatibilityFiles.ChildPath.__init__W   s   € Ø!ˆDŒLØˆD�Jr   c                 ó   — t        d«      S ©Nr   ©r>   r@   s    r   rA   z$CompatibilityFiles.ChildPath.iterdir[   ó   € Ü˜“8ˆOr   c                 óL   — | j                   j                  | j                  «      S r
   )r6   Úis_resourcer   r@   s    r   rD   z$CompatibilityFiles.ChildPath.is_file^   s   € Ø—<‘<×+Ñ+¨D¯I©IÓ6Ð6r   c                 ó$   — | j                  «        S r
   )rD   r@   s    r   rR   z#CompatibilityFiles.ChildPath.is_dira   s   € Ø—|‘|“~Ð%Ð%r   c                 óB   — t         j                  | j                  |«      S r
   )r%   rG   r   rH   s     r   rJ   z%CompatibilityFiles.ChildPath.joinpathd   s   € Ü%×0Ñ0°·±¸EÓBÐBr   c                 ó   — | j                   S r
   )rX   r@   s    r   r   z!CompatibilityFiles.ChildPath.nameg   s   € à—:‘:Ðr   c                 óh   — t        | j                  j                  | j                  «      |g|¢­i |¤ŽS r
   )r0   r6   rM   r   rN   s       r   rO   z!CompatibilityFiles.ChildPath.openk   s7   € ÜØ—‘×*Ñ*¨4¯9©9Ó5°tðØ>BòØFLñð r   NrP   rQ   r   r   r   r:   rV   Q   s:   „ ñ	ò
	ò	ò	7ò	&ò	Cð 
ñ	ó 
ð	ô	r   r:   c                   óD   — e Zd ZdZd„ Zd„ Zd„ ZeZd„ Ze	d„ «       Z
d	d„Zy)
úCompatibilityFiles.OrphanPathzŽ
        Orphan path, not tied to a module spec or resource reader.
        Can't be read and doesn't expose any meaningful children.
        c                 óD   — t        |«      dk  rt        d«      ‚|| _        y )Nr   z/Need at least one path part to construct a path)Úlenr+   Ú_path)r   Ú
path_partss     r   r   z&CompatibilityFiles.OrphanPath.__init__v   s!   € Ü�:‹ Ò"Ü Ð!RÓSÐSØ#ˆD�Jr   c                 ó   — t        d«      S rZ   r[   r@   s    r   rA   z%CompatibilityFiles.OrphanPath.iterdir{   r\   r   c                  ó   — yrC   r   r@   s    r   rD   z%CompatibilityFiles.OrphanPath.is_file~   rE   r   c                 óD   — t        j                  g | j                  ¢|‘­Ž S r
   )r%   rG   rg   rH   s     r   rJ   z&CompatibilityFiles.OrphanPath.joinpathƒ   s   € Ü%×0Ñ0ÐD°$·*±*ÐD¸eÒDÐDr   c                 ó    — | j                   d   S )Néÿÿÿÿ)rg   r@   s    r   r   z"CompatibilityFiles.OrphanPath.name†   s   € à—:‘:˜b‘>Ð!r   c                 ó   — t        d«      ‚)NzCan't open orphan path)ÚFileNotFoundErrorrN   s       r   rO   z"CompatibilityFiles.OrphanPath.openŠ   s   € Ü#Ð$<Ó=Ð=r   NrP   rQ   r   r   r   rG   rd   p   s<   „ ñ	ò
	$ò
	ò	ð ˆò	Eð 
ñ	"ó 
ð	"ô	>r   rG   c                 ó   — || _         y r
   r   r"   s     r   r   zCompatibilityFiles.__init__�   r#   r   c                 ó¾   — t        t        «      5  | j                  j                  j	                  | j                  j
                  «      cd d d «       S # 1 sw Y   y xY wr
   )r   ÚAttributeErrorr   r   r'   r   r@   s    r   r6   zCompatibilityFiles._reader�   sC   € ä”nÓ%ñ 	HØ—9‘9×#Ñ#×7Ñ7¸¿	¹	¿¹ÓG÷	H÷ 	Hò 	Hús   �9AÁAc                 ó:   — | j                   }t        |d«      r|S | S )zB
        Return the native reader if it supports files().
        Úfiles)r6   Úhasattr)r   r7   s     r   r&   zCompatibilityFiles._native•   s!   € ð —‘ˆÜ  ¨Ô1ˆvÐ;°tÐ;r   c                 ó.   — t        | j                  |«      S r
   )r   r6   )r   Úattrs     r   r   zCompatibilityFiles.__getattr__œ   s   € Ü�t—|‘| TÓ*Ð*r   c                 óV   — t         j                  | j                  | j                  «      S r
   )r%   rT   r   r6   r@   s    r   rt   zCompatibilityFiles.filesŸ   s   € Ü!×*Ñ*¨4¯9©9°d·l±lÓCÐCr   N)r   r   r   r   r   ÚTraversablerT   r:   rG   r   rS   r6   r&   r   rt   r   r   r   r%   r%   (   se   „ ñô
!X�3—?‘?ô !XôF�C—O‘Oô ô>>�S—_‘_ô >ò:ð ñHó ðHò<ò+óDr   r%   c                 ó6   — t        | j                  t        «      S )z`
    Construct a package spec with traversable compatibility
    on the spec/loader/reader.
    )r   Ú__spec__r    )Úpackages    r   Ú	wrap_specr}   £   s   € ô
 ˜W×-Ñ-Ô/IÓJÐJr   NrP   )Ú
contextlibr   Úior   Ú r   r   r    r0   r%   r}   r   r   r   ú<module>r�      s=   ðÝ Ý å ÷
(ñ 
(÷	7ñ 	7óV÷xDñ xDóvKr   