Viewing File: /opt/hc_python/lib/python3.12/site-packages/importlib_resources/__pycache__/abc.cpython-312.pyc

�

_��g����ddlZddlZddlZddlZddlmZmZmZmZm	Z	m
Z
mZmZm
Z
mZmZmZmZeeej&efZgd�ZGd�dej,��ZGd�de�ZeGd	�d
e��ZGd�de�Zy)
�N)
�Any�BinaryIO�Iterable�Iterator�NoReturn�Literal�Optional�Protocol�Text�TextIO�Union�overload�runtime_checkable)�ResourceReader�Traversable�TraversableResourcesc���eZdZdZej
dedefd��Zej
dedefd��Z	ej
dede
fd��Zej
dee
fd��Zy	)
rzDAbstract base class for loaders to provide resource reading support.�resource�returnc��t�)z�Return an opened, file-like object for binary reading.

        The 'resource' argument is expected to represent only a file name.
        If the resource cannot be found, FileNotFoundError is raised.
        ��FileNotFoundError��selfrs  �F/opt/hc_python/lib/python3.12/site-packages/importlib_resources/abc.py�
open_resourcezResourceReader.open_resources
�� ��c��t�)z�Return the file system path to the specified resource.

        The 'resource' argument is expected to represent only a file name.
        If the resource does not exist on the file system, raise
        FileNotFoundError.
        rrs  r�
resource_pathzResourceReader.resource_path)s
�� �r�pathc��t�)zjReturn True if the named 'path' is a resource.

        Files are resources, directories are not.
        r�rr s  r�is_resourcezResourceReader.is_resource6s
�� �rc��t�)z+Return an iterable of entries in `package`.r�rs r�contentszResourceReader.contents>s
�� �rN)�__name__�
__module__�__qualname__�__doc__�abc�abstractmethodrrrr�boolr#r�strr&�rrrrs���N����	 �d�	 �x�	 ��	 �	���
 �d�
 �t�
 ��
 �	��� �� �� �� �	��� �(�3�-� �� rr)�	metaclassc��eZdZy)�TraversalErrorN)r'r(r)r/rrr2r2Ds��rr2c��eZdZdZej
dedfd��Zdefd�Z		dde
ede
edefd�Zej
de
fd	��Zej
de
fd
��Zdeddfd�Zd
eddfd�Zeddeddededefd��Zededdededefd��Zej
	ddedededeeeffd��Zeej
defd���Zy)rz�
    An object with a subset of pathlib.Path methods suitable for
    traversing directories and opening files.

    Any exceptions that occur when accessing the backing resource
    may propagate unaltered.
    rc��y)z3
        Yield Traversable objects in self
        Nr/r%s r�iterdirzTraversable.iterdirR��rc�p�|jd�5}|j�cddd�S#1swYyxYw)z0
        Read contents of self as bytes
        �rbN��open�read)r�strms  r�
read_byteszTraversable.read_bytesXs$���Y�Y�t�_���9�9�;��_�_�s�,�5N�encoding�errorsc�t�|j||��5}|j�cddd�S#1swYyxYw)z/
        Read contents of self as text
        )r>r?Nr9)rr>r?r<s    r�	read_textzTraversable.read_text_s+���Y�Y���Y�
8�D��9�9�;�9�
8�
8�s�.�7c��y)z4
        Return True if self is a directory
        Nr/r%s r�is_dirzTraversable.is_dirhr6rc��y)z/
        Return True if self is a file
        Nr/r%s r�is_filezTraversable.is_filenr6r�descendantsc�L��|s|Stjjd�ttj
|�D��}t
|���fd�|j�D�}	t
|�}|j|�S#t$rtd�t|���wxYw)z�
        Return Traversable resolved with any descendants applied.

        Each descendant should be a path segment relative to self
        and each may contain multiple levels separated by
        ``posixpath.sep`` (``/``).
        c3�4K�|]}|j���y�w�N)�parts)�.0r s  r�	<genexpr>z'Traversable.joinpath.<locals>.<genexpr>~s����.
�#J�4�D�J�J�#J���c3�B�K�|]}|j�k(s�|���y�wrI��name)rK�traversable�targets  �rrLz'Traversable.joinpath.<locals>.<genexpr>�s#�����
�+9�K�[�=M�=M�QW�=W�K�>�s��z"Target not found during traversal.)�	itertools�chain�
from_iterable�map�pathlib�
PurePosixPath�nextr5�
StopIterationr2�list�joinpath)rrF�names�matches�matchrRs     @rr\zTraversable.joinpathts������K����-�-�.
�#&�w�'<�'<�k�#J�.
�
���e���
�+/�<�<�>�
��	���M�E�
�u�~�~�u�%�%��	�	� �4�f�d�5�k��
�	�s�)B� B#�childc�$�|j|�S)z2
        Return Traversable child in self
        )r\)rr`s  r�__truediv__zTraversable.__truediv__�s���}�}�U�#�#r�r�mode�args�kwargsc��yrIr/�rrdrerfs    rr:zTraversable.open�s��SVrr8c��yrIr/rhs    rr:zTraversable.open�s��PSrc��y)z�
        mode may be 'r' or 'rb' to open as text or binary. Return a handle
        suitable for reading (same as pathlib.Path.open).

        When opening as text, accepts encoding parameters such as those
        accepted by io.TextIOWrapper.
        Nr/rhs    rr:zTraversable.open�r6rc��y)zM
        The base name of this object without any parent references.
        Nr/r%s rrPzTraversable.name�r6r)NN)rc)r'r(r)r*r+r,rr5�bytesr=r	r.rAr-rCrE�StrPathr\rbrrrrr:rr
�propertyrPr/rrrrHs����	�����-�0����
�E��GK�� ��
��6>�s�m��	��	��������
	��������
&�W�&��&�2$��$�]�$��V����V�C�V�3�V�6�V��V�
�S����S�s�S�c�S�h�S��S�����	��	�&)�	�58�	�	�v�x��	 �	��	������c����rrc�x�eZdZdZej
dd��Zdedefd�Z	de
defd�Zdede
fd�Zdeefd	�Zy
)rzI
    The required interface for providing traversable
    resources.
    rc��y)z3Return a Traversable object for the loaded package.Nr/r%s r�fileszTraversableResources.files�r6rrc�^�|j�j|�jd�S)Nr8)rqr\r:rs  rrz"TraversableResources.open_resource�s$���z�z�|�$�$�X�.�3�3�D�9�9rc��t|��rIrrs  rrz"TraversableResources.resource_path�s
����)�)rr c�\�|j�j|�j�SrI)rqr\rEr"s  rr#z TraversableResources.is_resource�s"���z�z�|�$�$�T�*�2�2�4�4rc�L�d�|j�j�D�S)Nc3�4K�|]}|j���y�wrIrO)rK�items  rrLz0TraversableResources.contents.<locals>.<genexpr>�s����=�&<�d��	�	�&<�rM)rqr5r%s rr&zTraversableResources.contents�s��=�d�j�j�l�&:�&:�&<�=�=rN)rr)r'r(r)r*r+r,rqrmrrrrrr-r#rr.r&r/rrrr�sl���
	���B��B�:�g�:�(�:�*�c�*�h�*�5��5�D�5�>�(�3�-�>rr)r+rS�osrW�typingrrrrrrr	r
rrr
rrr.�PathLikerm�__all__�ABCMetar�	Exceptionr2rrr/rr�<module>r~s���
��	������ ��R�[�[��%�%�
&��
C��' �s�{�{�' �T	�Y�	��a�(�a��a�H>�>�>r
Back to Directory File Manager