Your IP : 3.148.117.240


Current Path : /opt/alt/python310/lib64/python3.10/importlib/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/importlib/__pycache__/resources.cpython-310.opt-2.pyc

o

6��fI�@s�ddlZddlZddlmZddlmZmZddlmZddlm	Z	ddl
mZddlm
Z
dd	lmZmZdd
lmZddlmZddlmZmZmZdd
lmZddlmZmZddlmZddlmZgd�Z ee!efZ"ee!ej#fZ$de"de$defdd�Z%		d3de"de$de!de!def
dd�Z&de"de$de'fdd�Z(		d3de"de$de!de!de!f
dd �Z)de"de$dd!fd"d#�Z*d$d%�Z+d&d'�Z,d(d)�Z-de"d*e!de.fd+d,�Z/de"dee!fd-d.�Z0ed/d0��Z1e1�2e�d1d2��Z3dS)4�N�)�_common)�as_file�files)�ResourceReader)�suppress)�ResourceLoader)�
ModuleSpec)�BytesIO�
TextIOWrapper)�Path)�
ModuleType)�ContextManager�Iterable�Union)�cast)�BinaryIO�TextIO)�Sequence)�singledispatch)�Package�Resourcerr�contentsr�is_resource�open_binary�	open_text�path�read_binary�	read_text�package�resource�returnc	Cs(	t�|�}t�|�}t�|�}|dur|�|�Stt|j�}|jdur(|j}n|j	dur9t
j�t
j�
|j	��g}|D]N}t
j�||�}z	t|dd�WSty�tt|j�}d}t|jd�r{tt��
|�|�}Wd�n1svwY|dur�t|�YSYq;wt|�d|j����)N�rb)�mode�get_dataz resource not found in )r�normalize_path�get_package�get_resource_reader�
open_resourcerr	�__spec__�submodule_search_locations�origin�osr�dirname�abspath�join�open�OSErrorr�loader�hasattrrr$r
�FileNotFoundError�name)	rr �reader�spec�pathsZpackage_path�	full_pathr2�data�r;�:/opt/alt/python310/lib64/python3.10/importlib/resources.pyr(s6






���r�utf-8�strict�encoding�errorscCs	tt||�||d�S)N)r?r@)rr)rr r?r@r;r;r<rJs�rcCs8	t||��}|��Wd�S1swYdS�N)r�read)rr �fpr;r;r<rVs$�rcCs<	t||||��}|��Wd�S1swYdSrA)rrB)rr r?r@rCr;r;r<r\s$�rzContextManager[Path]cCsB	t�t�|��}|rt|t�|��St�t�|��t�|���SrA)rr'r&�_path_from_readerr%rrZjoinpath)rr r6r;r;r<rks����rcCst||�p	t||�SrA)�_path_from_resource_path�_path_from_open_resource�r6r r;r;r<rD�s�rDcCs:tt��t|�|��Wd�S1swYdSrA)rr4rZ
resource_pathrGr;r;r<rE�s
$�rEcCs$t�|�|����}tj|j|d�S)N)�suffix)�ior
r(rBrZ	_tempfile)r6r Zsavedr;r;r<rF�srFr5cCs\	t�|�}t�|�t�|�}|dur|�|�Stt|��}||vr%dSt�|�|��S)NF)	rr&r%r'r�setr�from_package�is_file)rr5r6Zpackage_contentsr;r;r<r�s



rcCsV	t�|�}t�|�}|durt|���St�|�}|��r)tdd�|��D��SgS)Ncss�|]}|jVqdSrA)r5)�.0�itemr;r;r<�	<genexpr>�s�zcontents.<locals>.<genexpr>)	rr&r'�_ensure_sequencerrK�is_dir�listZiterdir)rr6Z
transversabler;r;r<r�s


rcCst|�SrA)rR��iterabler;r;r<rP�srPcCs|SrAr;rSr;r;r<�_�srU)r=r>)4r,rI�rrr�abcr�
contextlibrZ
importlib.abcr�importlib.machineryr	r
rZpathlibr�typesr
�typingrrrrZ	typing.iorrZcollections.abcr�	functoolsr�__all__�strr�PathLikerrr�bytesrrrrDrErF�boolrrrP�registerrUr;r;r;r<�<module>s~%�����
�	�����
���
�


?>