+
    i  c                   sv    ^ RI Ht ^ RIHt ^RIHt  ! R R4      t ! R R4      tRR lt ! R	 R
4      t	R t
R# )i    )suppress)TextIOWrapper)abcc                   s8   a  ] tR t^t o RtR 3R ltR tRtV tR# )SpecLoaderAdapterz6
Adapt a package spec to adapt the underlying loader.
c                    V P                   # N)loaderspec   &6/usr/lib64/python3.14/importlib/resources/_adapters.pyZ<lambda>ZSpecLoaderAdapter.<lambda>   s    $++    c                s,    Wn         V! V4      V n        R # r   )r   r   )selfr   Zadapter   &&&r
   __init__ZSpecLoaderAdapter.__init__   s    	dmr   c                .    \        V P                  V4      # r   )getattrr   r   name   &&r
   __getattr__ZSpecLoaderAdapter.__getattr__   s    tyy$''r   )r   r   N)	__name__
__module____qualname____firstlineno____doc__r   r   __static_attributes____classdictcell__Z__classdict__   @r
   r   r      s      &> $( (r   r   c                   s0   a  ] tR t^t o RtR tR tRtV tR# )TraversableResourcesLoaderz1
Adapt a loader to provide TraversableResources.
c                    Wn         R # r   r   r   r   r   r
   r   Z#TraversableResourcesLoader.__init__       	r   c                sH    \        V P                  4      P                  4       # r   )CompatibilityFilesr   _nativer   r   r
   get_resource_readerZ.TraversableResourcesLoader.get_resource_reader   s    !$)),4466r   r   N)	r   r   r   r   r   r   r$   r   r   r   r   r
   r   r      s     7 7r   r   c                 s^    VR 8X  d   \        V .VO5/ VB # VR8X  d   V # \        RV R24      h)rZrbzInvalid mode value 'z"', only 'r' and 'rb' are supported)r   
ValueError)Zfilemodeargskwargs   &&*,r
   _io_wrapperr+       s@    s{T3D3F33	
+D61ST
UUr   c                   s   a  ] tR t^(t o Rt ! R R]P                  4      t ! R R]P                  4      t ! R R]P                  4      t	R t
]R	 4       tR
 tR tR tRtV tR# )r"   z^
Adapter for an existing or non-existent resource reader
to provide a compatibility .files().
c                   sZ   a  ] tR t^.t o RtR tR tR t]tR t	]
R 4       tR
R ltRtV tR	# )CompatibilityFiles.SpecPathzS
Path tied to a module spec.
Can be read and exposes the resource reader children.
c                    Wn         W n        R # r   )_spec_reader)r   r   readerr   r
   r   Z$CompatibilityFiles.SpecPath.__init__4   s    J!Lr   c                s   a  S P                   '       g   \        R4      # \        V 3R  lS P                   P                  4        4       4      # )c              3   sd   <"   T F%  p\         P                  SP                  V4      x  K'  	  R # 5ir   )r"   	ChildPathr/   )Z.0Zpathr   s   & r
   Z	<genexpr>Z6CompatibilityFiles.SpecPath.iterdir.<locals>.<genexpr>;   s,      3D #,,T\\4@@3s   -0 )r/   iterZcontentsr   s   fr
   iterdirZ#CompatibilityFiles.SpecPath.iterdir8   s<    <<<Bx  LL113  r   c                    R # Fr2   r4   r	   r
   is_fileZ#CompatibilityFiles.SpecPath.is_file@       r   c                s    V P                   '       g   \        P                  V4      # \        P                  V P                   V4      # r   )r/   r"   
OrphanPathr1   r   Zotherr   r
   joinpathZ$CompatibilityFiles.SpecPath.joinpathE   s3    <<<)44U;;%//eDDr   c                s.    V P                   P                  # r   )r.   r   r4   r	   r
   r   Z CompatibilityFiles.SpecPath.nameJ   s    ::??"r   c                sT    \        V P                  P                  R 4      V.VO5/ VB # r   )r+   r/   open_resourcer   r'   r(   r)   r*   r
   openZ CompatibilityFiles.SpecPath.openN   s)    t||99$?WWPVWWr   )r/   r.   Nr%   r   r   r   r   r   r   r5   r8   is_dirr<   propertyr   r?   r   r   r   r   r
   SpecPathr,   .   sF     	
	"		 	E
 
	# 
	#	X 	Xr   rD   c                   s\   a  ] tR t^Qt o RtR tR tR tR tR t	]
R 4       tRR ltR	tV tR
# )CompatibilityFiles.ChildPathz_
Path tied to a resource reader child.
Can be read but doesn't expose any meaningful children.
c                r-   r   )r/   _name)r   r0   r   r   r
   r   Z%CompatibilityFiles.ChildPath.__init__W   s    !LJr   c                    \        R4      # Nr2   r3   r4   r	   r
   r5   Z$CompatibilityFiles.ChildPath.iterdir[       8Or   c                sL    V P                   P                  V P                  4      # r   )r/   Zis_resourcer   r4   r	   r
   r8   Z$CompatibilityFiles.ChildPath.is_file^   s    <<++DII66r   c                s,    V P                  4       '       * # r   )r8   r4   r	   r
   rB   Z#CompatibilityFiles.ChildPath.is_dira   s    ||~%%r   c                sB    \         P                  V P                  V4      # r   )r"   r:   r   r;   r   r
   r<   Z%CompatibilityFiles.ChildPath.joinpathd   s    %00EBBr   c                r   r   )rF   r4   r	   r
   r   Z!CompatibilityFiles.ChildPath.nameg   s    ::r   c                sh    \        V P                  P                  V P                  4      V.VO5/ VB # r   )r+   r/   r=   r   r>   r*   r
   r?   Z!CompatibilityFiles.ChildPath.openk   s7    **4995t>BFL r   )rF   r/   Nr@   rA   r   r   r
   r1   rE   Q   sB     	
			7	&	C 
	 
		 	r   r1   c                   sZ   a  ] tR t^pt o RtR tR tR t]tR t	]
R 4       tR
R ltRtV tR	# )CompatibilityFiles.OrphanPathzv
Orphan path, not tied to a module spec or resource reader.
Can't be read and doesn't expose any meaningful children.
c                sH    \        V4      ^8  d   \        R4      hWn        R# )   z/Need at least one path part to construct a pathN)Zlenr&   _path)r   Z
path_partss   &*r
   r   Z&CompatibilityFiles.OrphanPath.__init__v   s    :" !RSS#Jr   c                rG   rH   rI   r4   r	   r
   r5   Z%CompatibilityFiles.OrphanPath.iterdir{   rJ   r   c                r6   r7   r2   r4   r	   r
   r8   Z%CompatibilityFiles.OrphanPath.is_file~   r9   r   c                sH    \         P                  ! . V P                  OVN5!  # r   )r"   r:   rM   r;   r   r
   r<   Z&CompatibilityFiles.OrphanPath.joinpath   s    %00D$**DeDDr   c                s(    V P                   R,          # )rL   irM   r4   r	   r
   r   Z"CompatibilityFiles.OrphanPath.name   s    ::b>!r   c                s    \        R 4      h)zCan't open orphan path)ZFileNotFoundErrorr>   r*   r
   r?   Z"CompatibilityFiles.OrphanPath.open   s    #$<==r   rN   Nr@   rA   r   r   r
   r:   rK   p   sD     	
	$
		 	E 
	" 
	"	> 	>r   r:   c                r   r   r   r    r   r
   r   ZCompatibilityFiles.__init__   r!   r   c                s    \        \        4      ;_uu_ 4        V P                  P                  P	                  V P                  P
                  4      uuR R R 4       #   + '       g   i     R # ; ir   )r    ZAttributeErrorr   r   r$   r   r4   r	   r
   r/   ZCompatibilityFiles._reader   s<    n%%99##77		G &%%%s   9AA-	c                sF    V P                   p\        VR4      '       d   V# T # )z2
Return the native reader if it supports files().
files)r/   Zhasattr)r   r0   s   & r
   r#   ZCompatibilityFiles._native   s$      11v;t;r   c                r   r   )r   r/   )r   Zattrr   r
   r   ZCompatibilityFiles.__getattr__   s    t||T**r   c                sV    \         P                  V P                  V P                  4      # r   )r"   rD   r   r/   r4   r	   r
   rO   ZCompatibilityFiles.files   s    !**499dllCCr   r   N)r   r   r   r   r   r   ZTraversablerD   r1   r:   r   rC   r/   r#   r   rO   r   r   r   r   r
   r"   r"   (   sn     
!X3?? !XFCOO >>S__ >: H H<+D Dr   r"   c                s6    \        V P                  \        4      # )zT
Construct a package spec with traversable compatibility
on the spec/loader/reader.
)r   Z__spec__r   )Zpackager	   r
   	wrap_specrP      s    
 W--/IJJr   Nr@   )Z
contextlibr    Zior   Z r   r   r   r+   r"   rP   r2   r   r
   <module>rQ      s=      
( 
(	7 	7VxD xDvKr   