Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/test/test_importlib/resources/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/test/test_importlib/resources/__pycache__/util.cpython-312.opt-2.pyc

�

)Μg�����ddlZddlZddlZddlZddlZddlZddlmZddlmZddl	m
Z
ddlmZddl
mZGd�d	e
�Zdd
�Zdd�ZGd�d
ej$��ZGd�d�ZGd�de�Zy)�N�)�data01)�	zipdata01)�ResourceReader)�
import_helper)�
ModuleSpecc�0�eZdZd�Zd�Zd�Zd�Zd�Zd�Zy)�Readerc�8�t|�j|�y�N)�vars�update)�self�kwargss  �?/usr/local/lib/python3.12/test/test_importlib/resources/util.py�__init__zReader.__init__s���T�
���&�!�c��|Sr��r�packages  r�get_resource_readerzReader.get_resource_readers���rc�t�||_t|jt�r|j�|jSr)�_path�
isinstance�file�	Exception�r�paths  r�
open_resourcezReader.open_resources*����
��d�i�i��+��)�)�O��y�y�rc�t�||_t|jt�r|j�|jSr)rrrr)r�path_s  r�
resource_pathzReader.resource_paths*����
��d�i�i��+��)�)�O��y�y�rc����|_t|jt�r|j�d�}t	�fd�t||j�D��S)Nc�$�|jd�S)N�/)�split)�entrys r�partz Reader.is_resource.<locals>.part)s���;�;�s�#�#rc3�N�K�|]}t|�dk(xr|d�k(���y�w)rrN)�len)�.0�partsr"s  �r�	<genexpr>z%Reader.is_resource.<locals>.<genexpr>,s/�����
�?X�e�C��J�!�O�1��a��E� 1�1�?X�s�"%)rrrr�any�map�	_contents)rr"r)s ` r�is_resourcezReader.is_resource$sM�����
��d�i�i��+��)�)�O�	$��
�?B�4����?X�
�
�	
rc#�K�t|jt�r|j�|jEd{���y7��wr)rrrr1�rs r�contentszReader.contents0s*�����d�i�i��+��)�)�O��>�>�!�!�s�6A�>�AN)	�__name__�
__module__�__qualname__rrr r#r2r5rrrr
r
s ��"����

�"rr
c�n�d}tj|�}t||d|��}||_||_|S)N�testingpackagezdoes-not-exist)�origin�
is_package)�types�
ModuleTyper�__spec__�
__loader__)�loaderr<�name�module�specs     r�create_package_from_loaderrE6s<���D�
�
�
�d�
#�F��d�F�+;�
�S�D��F�O��F���Mrc�2�tt|||��|�S)N)rrr1)rEr
)rrr<r5s    r�create_packagerG?s��%��D�t�x�8���rc�b�eZdZ	ejd��Zd�Zd�Zd�Zd�Z	d�Z
d�Zd�Zd	�Z
y
)�CommonTestsc��yrr)rrrs   r�executezCommonTests.executeKs��	rc�F�	|jtjd�y�N�
utf-8.file)rKrr6r4s r�test_package_namezCommonTests.test_package_nameRs��	�	
���V�_�_�l�3rc�2�	|jtd�yrM�rKrr4s r�test_package_objectzCommonTests.test_package_objectXs��	�	
���V�\�*rc�6�	d}|jt|�yrMrQrs  r�test_string_pathzCommonTests.test_string_path^s��	������V�T�"rc�\�	tjd�}|jt|�yrM)�pathlib�PurePathrKrrs  r�test_pathlib_pathzCommonTests.test_pathlib_pathes'��	�����-�����V�T�"rc��	tjtj=|j	tjd�yrM)�sys�modulesrr6rKr4s r�$test_importing_module_as_side_effectz0CommonTests.test_importing_module_as_side_effectls+��	�
�K�K����(����V�_�_�l�3rc���	tjd�}t|t���}|j	|d�|j|jjd�y�Ns
Hello, world!�rrrN)�io�BytesIOrG�FileNotFoundErrorrK�assertEqualr@r)r�
bytes_datars   r�test_missing_pathzCommonTests.test_missing_pathssR��	�
�Z�Z� 0�1�
� �j�7H�7J�K�����W�l�+�����+�+�1�1�<�@rc���tjd�}t}t||��}|j	|d�|j|jjd�yr^)r`ra�__file__rGrKrcr@r)rrdrrs    r�test_extant_pathzCommonTests.test_extant_path~sN���Z�Z� 0�1�
��� �j�t�<�����W�l�+�����+�+�1�1�<�@rc��tt�t���}|jt�5|j|d�ddd�y#1swYyxYw)Nr_rN)rGrb�assertRaisesrKrs  r�test_useless_loaderzCommonTests.test_useless_loader�s?�� �&7�&9�@Q�@S�T��
�
�
�0�
1��L�L��,�/�2�
1�
1�s�A�AN)r6r7r8�abc�abstractmethodrKrOrRrTrXr\rerhrkrrrrIrIFsK���	������4�+�#�#�4�	A�	A�0rrI)�	metaclassc�6�eZdZdZed��Zed��Zd�Zy)�ZipSetupBaseNc��tj|jj�}|j}t|dz�|_tjj|j�tjd�|_y)Nzziptestdata.zip�ziptestdata)
rV�Path�
ZIP_MODULErg�parent�str�	_zip_pathrZr�append�	importlib�
import_module�data)�cls�	data_path�data_dirs   r�
setUpClasszZipSetupBase.setUpClass�s]���L�L����!8�!8�9�	��#�#���H�'8�8�9��
�������
�
�&��*�*�=�9��rc�>�	tjj|j�	tj
|j=tj|jj=	|`|`y#t$rY�RwxYw#t$rY� wxYw#t$rYywxYwr)rZr�removerw�
ValueError�path_importer_cacher[r{r6�KeyError�AttributeError)r|s r�
tearDownClasszZipSetupBase.tearDownClass�s���	��H�H�O�O�C�M�M�*�	��'�'��
�
�6����C�H�H�-�-�.�	����
���	��	���	��	���	��	�s5�)A2�AB�-B�2	A>�=A>�	B
�B
�	B�Bc�n�tj�}|jtjg|���yr)r�
modules_setup�
addCleanup�modules_cleanup)rr[s  r�setUpzZipSetupBase.setUp�s)���-�-�/������
�5�5�@��@r)r6r7r8rt�classmethodrr�r�rrrrprp�s3���J��:��:�����$Arrpc��eZdZeZy)�ZipSetupN)r6r7r8rrtrrrr�r��s���Jrr�)T)NNTr)rlryr`rZr=rV�rr�importlib.resources.abcr�test.supportr�importlib.machineryrr
rErG�ABCMetarIrpr�rrr�<module>r�sk��
��	�
�����2�&�+�""�^�""�J��F0�C�K�K�F0�R A� A�F�|�r

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists