
    Ki                     t    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	 jr " S
 S5      r	S r
g)    )suppress)TextIOWrapper   )abcc                   ,    \ rS rSrSrS 4S jrS rSrg)SpecLoaderAdapter   z6
Adapt a package spec to adapt the underlying loader.
c                     U R                   $ N)loaderspecs    _/var/www/html/dynamic-report/venv/lib/python3.13/site-packages/importlib_resources/_adapters.py<lambda>SpecLoaderAdapter.<lambda>   s    $++    c                 *    Xl         U" U5      U l        g r   )r   r   )selfr   adapters      r   __init__SpecLoaderAdapter.__init__   s    	dmr   c                 .    [        U R                  U5      $ r   )getattrr   r   names     r   __getattr__SpecLoaderAdapter.__getattr__   s    tyy$''r   )r   r   N)__name__
__module____qualname____firstlineno____doc__r   r   __static_attributes__ r   r   r   r      s     &> $(r   r   c                   $    \ rS rSrSrS rS rSrg)TraversableResourcesLoader   z1
Adapt a loader to provide TraversableResources.
c                     Xl         g r   r   r   r   s     r   r   #TraversableResourcesLoader.__init__       	r   c                 H    [        U R                  5      R                  5       $ r   )CompatibilityFilesr   _nativer   s     r   get_resource_reader.TraversableResourcesLoader.get_resource_reader   s    !$)),4466r   r   N)r   r   r    r!   r"   r   r/   r#   r$   r   r   r&   r&      s    7r   r&   c                 Z    US:X  a  [        U /UQ70 UD6$ US:X  a  U $ [        SU S35      e)NrrbzInvalid mode value 'z"', only 'r' and 'rb' are supported)r   
ValueError)filemodeargskwargss       r   _io_wrapperr9       s@    s{T3D3F33	
+D61ST
UUr   c                       \ rS rSrSr " S S\R                  5      r " S S\R                  5      r " S S\R                  5      r	S	 r
\S
 5       rS rS rS rSrg)r-   (   z^
Adapter for an existing or non-existent resource reader
to provide a compatibility .files().
c                   N    \ rS rSrSrS rS rS r\rS r	\
S 5       rSS jrS	rg
)zCompatibilityFiles.SpecPath.   zS
Path tied to a module spec.
Can be read and exposes the resource reader children.
c                     Xl         X l        g r   )_spec_reader)r   r   readers      r   r   $CompatibilityFiles.SpecPath.__init__4   s    J!Lr   c                    ^  T R                   (       d  [        S5      $ [        U 4S jT R                   R                  5        5       5      $ )Nr$   c              3   d   >#    U  H%  n[         R                  TR                  U5      v   M'     g 7fr   )r-   	ChildPathr@   ).0pathr   s     r   	<genexpr>6CompatibilityFiles.SpecPath.iterdir.<locals>.<genexpr>;   s,      3D #,,T\\4@@3s   -0)r@   itercontentsr   s   `r   iterdir#CompatibilityFiles.SpecPath.iterdir8   s:    <<Bx  LL113  r   c                     gNFr$   rL   s    r   is_file#CompatibilityFiles.SpecPath.is_file@       r   c                     U R                   (       d  [        R                  U5      $ [        R                  U R                   U5      $ r   )r@   r-   
OrphanPathrE   r   others     r   joinpath$CompatibilityFiles.SpecPath.joinpathE   s1    <<)44U;;%//eDDr   c                 .    U R                   R                  $ r   )r?   r   rL   s    r   r    CompatibilityFiles.SpecPath.nameJ   s    ::??"r   c                 T    [        U R                  R                  S 5      U/UQ70 UD6$ r   )r9   r@   open_resourcer   r6   r7   r8   s       r   open CompatibilityFiles.SpecPath.openN   s)    t||99$?WWPVWWr   )r@   r?   Nr2   r   r   r    r!   r"   r   rM   rQ   is_dirrX   propertyr   r_   r#   r$   r   r   SpecPathCompatibilityFiles.SpecPath.   s=    	
	"		 	E
 
	# 
	#	Xr   re   c                   P    \ rS rSrSrS rS rS rS rS r	\
S 5       rSS	 jrS
rg)zCompatibilityFiles.ChildPathQ   z_
Path tied to a resource reader child.
Can be read but doesn't expose any meaningful children.
c                     Xl         X l        g r   )r@   _name)r   rA   r   s      r   r   %CompatibilityFiles.ChildPath.__init__W   s    !LJr   c                     [        S5      $ Nr$   rJ   rL   s    r   rM   $CompatibilityFiles.ChildPath.iterdir[       8Or   c                 L    U R                   R                  U R                  5      $ r   )r@   is_resourcer   rL   s    r   rQ   $CompatibilityFiles.ChildPath.is_file^   s    <<++DII66r   c                 ,    U R                  5       (       + $ r   )rQ   rL   s    r   rc   #CompatibilityFiles.ChildPath.is_dira   s    ||~%%r   c                 B    [         R                  U R                  U5      $ r   )r-   rU   r   rV   s     r   rX   %CompatibilityFiles.ChildPath.joinpathd   s    %00EBBr   c                     U R                   $ r   )rj   rL   s    r   r   !CompatibilityFiles.ChildPath.nameg   s    ::r   c                 h    [        U R                  R                  U R                  5      U/UQ70 UD6$ r   )r9   r@   r]   r   r^   s       r   r_   !CompatibilityFiles.ChildPath.openk   s7    **4995t>BFL r   )rj   r@   Nra   rb   r$   r   r   rE   CompatibilityFiles.ChildPathQ   s:    	
			7	&	C 
	 
		r   rE   c                   N    \ rS rSrSrS rS rS r\rS r	\
S 5       rSS jrS	rg
)zCompatibilityFiles.OrphanPathp   zv
Orphan path, not tied to a module spec or resource reader.
Can't be read and doesn't expose any meaningful children.
c                 D    [        U5      S:  a  [        S5      eXl        g )Nr   z/Need at least one path part to construct a path)lenr4   _path)r   
path_partss     r   r   &CompatibilityFiles.OrphanPath.__init__v   s    :" !RSS#Jr   c                     [        S5      $ rm   rn   rL   s    r   rM   %CompatibilityFiles.OrphanPath.iterdir{   rp   r   c                     grP   r$   rL   s    r   rQ   %CompatibilityFiles.OrphanPath.is_file~   rS   r   c                 F    [         R                  " / U R                  QUP76 $ r   )r-   rU   r   rV   s     r   rX   &CompatibilityFiles.OrphanPath.joinpath   s    %00D$**DeDDr   c                      U R                   S   $ )Nr   rL   s    r   r   "CompatibilityFiles.OrphanPath.name   s    ::b>!r   c                     [        S5      e)NzCan't open orphan path)FileNotFoundErrorr^   s       r   r_   "CompatibilityFiles.OrphanPath.open   s    #$<==r   r   Nra   rb   r$   r   r   rU   CompatibilityFiles.OrphanPathp   s<    	
	$
		 	E 
	" 
	"	>r   rU   c                     Xl         g r   r   r)   s     r   r   CompatibilityFiles.__init__   r+   r   c                     [        [        5         U R                  R                  R	                  U R                  R
                  5      sS S S 5        $ ! , (       d  f       g = fr   )r   AttributeErrorr   r   r/   r   rL   s    r   r@   CompatibilityFiles._reader   s6    n%99##77		G &%%s   9A
A!c                 D    U R                   n[        US5      (       a  U$ U $ )z2
Return the native reader if it supports files().
files)r@   hasattr)r   rA   s     r   r.   CompatibilityFiles._native   s$      11v;t;r   c                 .    [        U R                  U5      $ r   )r   r@   )r   attrs     r   r   CompatibilityFiles.__getattr__   s    t||T**r   c                 V    [         R                  U R                  U R                  5      $ r   )r-   re   r   r@   rL   s    r   r   CompatibilityFiles.files   s    !**499dllCCr   r   N)r   r   r    r!   r"   r   Traversablere   rE   rU   r   rd   r@   r.   r   r   r#   r$   r   r   r-   r-   (   se    
!X3?? !XFCOO >>S__ >: H H<+Dr   r-   c                 6    [        U R                  [        5      $ )zT
Construct a package spec with traversable compatibility
on the spec/loader/reader.
)r   __spec__r&   )packages    r   	wrap_specr      s    
 W--/IJJr   Nra   )
contextlibr   ior    r   r   r&   r9   r-   r   r$   r   r   <module>r      s=      
( 
(	7 	7VxD xDvKr   