ok

Mini Shell

Direktori : /opt/alt/python311/lib64/python3.11/importlib/resources/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/importlib/resources/__pycache__/simple.cpython-311.pyc

�

�f3���dZddlZddlZddlZddlmZmZddlmZmZGd�dej	��Z
Gd�d	e��ZGd
�de��ZGd�d
ee
��Z
dS)z+
Interface adapters for low-level readers.
�N)�BinaryIO�List�)�Traversable�TraversableResourcesc��eZdZdZejd���Zejd���Zejd���Z	ejd���Z
ed���ZdS)�SimpleReaderzQ
    The minimum, low-level interface required from a resource
    provider.
    c��dS)zP
        The name of the package for which this reader loads resources.
        N���selfs �A/opt/alt/python311/lib64/python3.11/importlib/resources/simple.py�packagezSimpleReader.package�����c��dS)zo
        Obtain an iterable of SimpleReader for available
        child containers (e.g. directories).
        Nrrs r�childrenzSimpleReader.childrenrrc��dS)zL
        Obtain available named resources for this virtual package.
        Nrrs r�	resourceszSimpleReader.resources"rrc��dS)z:
        Obtain a File-like for a named resource.
        Nr)r
�resources  r�open_binaryzSimpleReader.open_binary)rrc�B�|j�d��dS)N�.���)r�splitrs r�namezSimpleReader.name0s���|�!�!�#�&�&�r�*�*rN)
�__name__�
__module__�__qualname__�__doc__�abc�abstractpropertyr�abstractmethodrrr�propertyrrrrr	r	
s���������
	�������	�������	�������	��������+�+��X�+�+�+rr	c�2�eZdZdZd�Zd�Zd�Zd	d�Zd�ZdS)
�ResourceHandlez9
    Handle to a named resource in a ResourceReader.
    c�"�||_||_dS�N)�parentr)r
r*rs   r�__init__zResourceHandle.__init__:s�������	�	�	rc��dS�NTrrs r�is_filezResourceHandle.is_file?����trc��dS�NFrrs r�is_dirzResourceHandle.is_dirB����ur�rc��|jj�|j��}d|vrt	j|g|�Ri|��}|S)N�b)r*�readerrr�io�
TextIOWrapper)r
�mode�args�kwargs�streams     r�openzResourceHandle.openEsJ����#�/�/��	�:�:���d�?�?��%�f�>�t�>�>�>�v�>�>�F��
rc� �td���)NzCannot traverse into a resource)�RuntimeError)r
rs  r�joinpathzResourceHandle.joinpathKs���<�=�=�=rN)r4)	rrr r!r+r.r2r>rArrrr'r'5sn�����������
����������>�>�>�>�>rr'c�L�eZdZdZd�Zd�Zd�Zd�Zd�Ze	d���Z
d�Zd	S)
�ResourceContainerzI
    Traversable container for a package's resources via its reader.
    c��||_dSr))r7)r
r7s  rr+zResourceContainer.__init__Ts
������rc��dSr-rrs rr2zResourceContainer.is_dirXr/rc��dSr1rrs rr.zResourceContainer.is_file[r3rc����fd��jjD��}tt�j�����}tj||��S)Nc3�8�K�|]}t�|��V��dSr))r')�.0rr
s  �r�	<genexpr>z,ResourceContainer.iterdir.<locals>.<genexpr>_s-�����N�N����d�+�+�N�N�N�N�N�Nr)r7r�maprCr�	itertools�chain)r
�files�dirss`  r�iterdirzResourceContainer.iterdir^sQ���N�N�N�N���8M�N�N�N���$�d�k�&:�&:�&<�&<�=�=����u�d�+�+�+rc��t���r))�IsADirectoryError)r
r;r<s   rr>zResourceContainer.opencs���!�!�!rc#�JK�|D]}|�d��Ed{V���dS)N�/)r)�compound_namesrs  r�_flattenzResourceContainer._flattenfsD����"�	'�	'�D��z�z�#���&�&�&�&�&�&�&�&�	'�	'rc���|s|S|�|��}t|���t�fd�|���D����j|�S)Nc3�2�K�|]}|j�k�
|V��dSr))r)rI�traversable�targets  �rrJz-ResourceContainer.joinpath.<locals>.<genexpr>ps:�����
�
�'�[�=M�QW�=W�=W�K�=W�=W�=W�=W�
�
r)rV�nextrPrA)r
�descendants�namesrZs   @rrAzResourceContainer.joinpathksz����	��K��
�
�k�*�*���e�����t�
�
�
�
�+/�<�<�>�>�
�
�
�
�
�
�E��	rN)rrr r!r+r2r.rPr>�staticmethodrVrArrrrCrCOs������������������,�,�,�
"�"�"��'�'��\�'�����rrCc��eZdZdZd�ZdS)�TraversableReaderz�
    A TraversableResources based on SimpleReader. Resource providers
    may derive from this class to provide the TraversableResources
    interface by supplying the SimpleReader interface.
    c� �t|��Sr))rCrs rrNzTraversableReader.files|s�� ��&�&�&rN)rrr r!rNrrrr`r`us-��������'�'�'�'�'rr`)r!r"r8rL�typingrrrr�ABCr	r'rCr`rrr�<module>rds�����
�
�
�	�	�	�	�����!�!�!�!�!�!�!�!�2�2�2�2�2�2�2�2�%+�%+�%+�%+�%+�3�7�%+�%+�%+�P>�>�>�>�>�[�>�>�>�4#�#�#�#�#��#�#�#�L'�'�'�'�'�,�l�'�'�'�'�'r

Zerion Mini Shell 1.0