Sindbad~EG File Manager
�
�X�fS���ddlZddlZddlZddlZddlZddlmZmZmZm Z m
Z
mZmZddlm
Z
mZddlmZeeej"efZgd�ZGd�dej(��ZGd �d
e�Ze
Gd�de��ZGd
�de�Zy)�N)�Any�BinaryIO�Iterable�Iterator�NoReturn�Text�Optional)�runtime_checkable�Protocol)�Union)�ResourceReader�Traversable�TraversableResourcesc���eZdZdZej
dedefd��Zej
dedefd��Z ej
dede
fd��Zej
dee
fd��Zy )
r
zDAbstract 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 �5/usr/src/Python-3.12.7/Lib/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_paths
�� �r�pathc��t�)zjReturn True if the named 'path' is a resource.
Files are resources, directories are not.
r�rrs r�is_resourcezResourceReader.is_resource,s
�� �rc��t�)z+Return an iterable of entries in `package`.r�rs r�contentszResourceReader.contents4s
�� �rN)�__name__�
__module__�__qualname__�__doc__�abc�abstractmethodrrrr�boolr r�strr#�rrr
r
s���N���� �d� �x� �� � ���
�d�
�t�
��
� ��� �� �� �� � ��� �(�3�-� �� rr
)� metaclassc��eZdZy)�TraversalErrorN)r$r%r&r,rrr/r/:s��rr/c�2�eZdZdZej
dedfd��Zdefd�Z dde
edefd�Zej
de
fd��Zej
de
fd ��Zd
eddfd�Zdeddfd
�Zej
dd��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.iterdirH��rc�p�|jd�5}|j�cddd�S#1swYyxYw)z0
Read contents of self as bytes
�rbN��open�read)r�strms r�
read_byteszTraversable.read_bytesNs$���Y�Y�t�_���9�9�;��_�_�s�,�5N�encodingc�r�|j|��5}|j�cddd�S#1swYyxYw)z/
Read contents of self as text
)r;Nr6)rr;r9s r� read_textzTraversable.read_textUs)���Y�Y��Y�
)�T��9�9�;�*�
)�
)�s�-�6c��y)z4
Return True if self is a directory
Nr,r"s r�is_dirzTraversable.is_dir\r3rc��y)z/
Return True if self is a file
Nr,r"s r�is_filezTraversable.is_filebr3r�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)�.0rs r� <genexpr>z'Traversable.joinpath.<locals>.<genexpr>rs����.
�#J�4�D�J�J�#J���c3�B�K�|]}|j�k(s�|���y�wrE��name)rG�traversable�targets �rrHz'Traversable.joinpath.<locals>.<genexpr>vs#�����
�+9�K�[�=M�=M�QW�=W�K�>�s��z"Target not found during traversal.)� itertools�chain�
from_iterable�map�pathlib�
PurePosixPath�nextr2�
StopIterationr/�list�joinpath)rrB�names�matches�matchrNs @rrXzTraversable.joinpathhs������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
)rX)rr\s r�__truediv__zTraversable.__truediv__�s���}�}�U�#�#rc��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,)r�mode�args�kwargss rr7zTraversable.open�r3rc��y)zM
The base name of this object without any parent references.
Nr,r"s rrLzTraversable.name�r3rrE)�r)r$r%r&r'r(r)rr2�bytesr:r r+r=r*r?rA�StrPathrXr^r7�propertyrLr,rrrr>s���� �����-�0����
�E���(�3�-��3�� ��������
��������
&�W�&��&�2$��$�]�$� �����������c����rrc��eZdZdZej
dd��Zdedejfd�Z
dedefd�Z
dedefd�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�r3rrc�^�|j�j|�jd�S)Nr5)rjrXr7rs rrz"TraversableResources.open_resource�s$���z�z�|�$�$�X�.�3�3�D�9�9rc��t|��rErrs rrz"TraversableResources.resource_path�s
����)�)rrc�\�|j�j|�j�SrE)rjrXrArs rr z TraversableResources.is_resource�s"���z�z�|�$�$�T�*�2�2�4�4rc�L�d�|j�j�D�S)Nc3�4K�|]}|j���y�wrErK)rG�items rrHz0TraversableResources.contents.<locals>.<genexpr>�s����=�&<�d�� � �&<�rI)rjr2r"s rr#zTraversableResources.contents�s��=�d�j�j�l�&:�&:�&<�=�=rN)rr)r$r%r&r'r(r)rjrf�io�BufferedReaderrrrrr*r rr+r#r,rrrr�sr���
���B��B�:�g�:�"�2C�2C�:�*�c�*�h�*�5��5�D�5�>�(�3�-�>rr)r(rqrO�osrS�typingrrrrrrr r
rrr+�PathLikerf�__all__�ABCMetar
� Exceptionr/rrr,rr�<module>rys���
� �� ��N�N�N�.����R�[�[��%�%�
&��
C��' �s�{�{�' �T �Y� ��W�(�W��W�t>�>�>r
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists