����JFIF���������
1#@!#!123s
D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
alt
/
python312
/
lib64
/
python3.12
/
importlib
/
resources
/
__pycache__
/
Filename :
readers.cpython-312.opt-1.pyc
back
Copy
� ����5[Yh�����������������������������d�dl�Z�d�dlZd�dlZd�dlZd�dlZddlmZ�ddlmZ�d��Z �G�d��dej�������������������������Z�G�d��d ej�������������������������Z�G�d ��dej�������������������������Z�G�d��d ej�������������������������Zy)�����N����)�abc)�onlyc������������������R�����t��������t��������j������������������j������������������|���������������S��N)�iter�collections�OrderedDict�fromkeys)�itemss��� �B/opt/alt/python312/lib64/python3.12/importlib/resources/readers.py�remove_duplicatesr������s��������'�'�0�0��7�8�8�����c�������������������������e�Zd�Zd��Zd��Zd��Zy)� FileReaderc������������������`�����t��������j������������������|j�������������������������j������������������|�_��������y�r���)�pathlib�Path�path�parent)�self�loaders��� r ����__init__zFileReader.__init__���s�������L�L����-�4�4�� r���c������������������J�����t��������|�j������������������j������������������|��������������S��z{ Return the file system path to prevent `resources.path()` from creating a temporary copy. ��strr����joinpath�r����resources��� r ���� resource_pathzFileReader.resource_path������������4�9�9�%�%�h�/�0�0r���c�����������������������|�j�������������������S�r����r����r���s��� r ����fileszFileReader.files�����������y�y�r���N��__name__� __module__�__qualname__r���r!���r&�����r���r ���r���r������s������5�1�r���r���c��������������������0�������e�Zd�Zd��Z��fd�Zd��Zd��Z��xZS�)� ZipReaderc������������������������|j�������������������j������������������dd�������|�_���������|j������������������|�������r-|j������������������d�������\��}}}|�xj�������������������|dz���z ��c_���������|j������������������|�_��������y�)N�\�/�.)�prefix�replace� is_package� rpartition�archive)r���r����module�_�names��� r ���r���zZipReader.__init__!���s[�������m�m�+�+�D�#�6������V�$��*�*�3�/�J�A�q�$��K�K�4�#�:�%�K��~�~��r���c������������������v������ �t����������|����|�������S�#�t��������$�r}t��������|j������������������d�����������d�}~ww�xY�w�Nr���)�super� open_resource�KeyError�FileNotFoundError�args)r���r ����exc� __class__s��� �r ���r>���zZipReader.open_resource(���s;������� 1��7�(��2�2���� 1�#�C�H�H�Q�K�0�0�� 1�s������ 8�3�8c�����������������������|�j��������������������������j������������������|�������}|j��������������������������xr�|j��������������������������S�)zf Workaround for `zipfile.Path.is_file` returning true for non-existent paths. )r&���r����is_file�exists)r���r����targets��� r ����is_resourcezZipReader.is_resource.���s2������ �����&�&�t�,���~�~��3�F�M�M�O�3r���c������������������V�����t��������j������������������|�j������������������|�j�������������������������S�r���)�zipfiler���r7���r3���r%���s��� r ���r&���zZipReader.files6���s�������|�|�D�L�L�$�+�+�6�6r���)r)���r*���r+���r���r>���rH���r&���� __classcell__�rC���s���@r ���r.���r.��� ���s�������&�1�4�7r���r.���c��������������������r�������e�Zd�ZdZd��Zd��Zd��Zd��Zd��Zd��Z ��fd�Z ed ����������Zd ��Z ed����������Zd��Z��xZS�) �MultiplexedPathz� Given a series of Traversable objects, implement a merged version of the interface across all objects. Useful for namespace packages which may be multihomed at a single name. c������������������������t��������t��������t��������j������������������t ��������|���������������������|�_��������|�j ������������������s d}t ��������|��������t��������d��|�j ������������������D����������������st��������d��������y�)Nz.MultiplexedPath must contain at least one pathc��������������3����<���K����|�]��}|j�������������������������������y��wr���)�is_dir��.0r���s��� r ���� <genexpr>z+MultiplexedPath.__init__.<locals>.<genexpr>G���s���������9�[�T�4�;�;�=�[�s����z)MultiplexedPath only supports directories) �list�mapr���r���r����_pathsr@����all�NotADirectoryError)r����paths�messages��� r ���r���zMultiplexedPath.__init__B���sY�������3�w�|�|�->�u�-E�F�G����{�{�F�G�#�G�,�,��9�T�[�[�9�9�$�%P�Q�Q��:r���c������������������������d��|�j�������������������D���������}t��������j������������������d�������}t��������j������������������t��������||��������|��������}t ��������|�j������������������d��|D����������������S�)Nc��������������3����J���K����|�]��}|j��������������������������D�]��}|�������y��wr���)�iterdir)rS���r����childs��� r ���rT���z*MultiplexedPath.iterdir.<locals>.<genexpr>K���s���������N�k�d�t�|�|�~�e�E�~�E�k�s����!#r:���)�keyc��������������3����&���K����|�] ��\��}}|�����y��wr���r,���)rS���r:����locss��� r ���rT���z*MultiplexedPath.iterdir.<locals>.<genexpr>N���s���������!@��:�4��$��s����)rW����operator� attrgetter� itertools�groupby�sortedrV����_follow)r����children�by_name�groupss��� r ���r^���zMultiplexedPath.iterdirJ���sP������N�d�k�k�N���%�%�f�-���"�"�6�(��#@�g�N���4�<�<�!@��!@�A�Ar���c�����������������������t��������|���d����������Nz is not a file�r@���r%���s��� r ���� read_byteszMultiplexedPath.read_bytesP�����������4�&�� 7�8�8r���c�����������������������t��������|���d���������rm���rn����r���rA����kwargss��� r ���� read_textzMultiplexedPath.read_textS���rp���r���c������������������������y)NTr,���r%���s��� r ���rQ���zMultiplexedPath.is_dirV���s������r���c������������������������y)NFr,���r%���s��� r ���rE���zMultiplexedPath.is_fileY���s������r���c������������������������ �t���������|����|��S�#�t��������j������������������$�r��|�j������������������d���j������������������|��cY�S�w�xY�wr<���)r=���r���r����TraversalErrorrW���)r����descendantsrC���s��� �r ���r���zMultiplexedPath.joinpath\���sJ������� 9��7�#�[�1�1���!�!�� 9��+�4�;�;�q�>�*�*�K�8�8� 9�s������/A��Ac�����������������������t��������j������������������|d�������\��}}} �t��������|�������S�#�t��������$�r%� ��|�|��cY�S�#�t��������$�r�t��������|�������cY�cY�S�w�xY�ww�xY�w)z� Construct a MultiplexedPath if needed. If children contains a sole element, return it. Otherwise, return a MultiplexedPath of the items. Unless one of the items is not a Directory, then return the first. ����)re����teer���� ValueErrorrY����next)�clsri����subdirs�one_dir�one_files��� r ���rh���zMultiplexedPath._followd���sa�������&/�]�]�8�Q�%?�"���(� &���=� ���� &� &��G�}�$��%�� &��H�~�%� &�� &�s)���� '�� A�8�A�A�A�A�Ac�����������������������t��������|���d���������rm���rn���rr���s��� r ����openzMultiplexedPath.openw���rp���r���c������������������4�����|�j�������������������d���j������������������S�r<���)rW���r:���r%���s��� r ���r:���zMultiplexedPath.namez���s�������{�{�1�~�"�"�"r���c������������������R�����dj������������������d��|�j������������������D����������������}d|��d�S�)Nz, c��������������3����(���K����|�] ��}d�|��d�������y�w)�'Nr,���rR���s��� r ���rT���z+MultiplexedPath.__repr__.<locals>.<genexpr>���s���������>�+�$�A�d�V�1�+�+�s����zMultiplexedPath(�))�joinrW���)r���rZ���s��� r ����__repr__zMultiplexedPath.__repr__~���s)������� � �>�$�+�+�>�>��!�%���*�*r���)r)���r*���r+����__doc__r���r^���ro���rt���rQ���rE���r����classmethodrh���r�����propertyr:���r����rK���rL���s���@r ���rN���rN���:���s_��������R�B�9�9���9���&���&�$9���#���#�+r���rN���c�������������������������e�Zd�Zd��Zd��Zd��Zy)�NamespaceReaderc������������������`�����dt��������|�������vrt��������d��������t��������t��������|���������|�_��������y�)N� NamespacePathzInvalid path)r���r}���rN���rU���r���)r����namespace_paths��� r ���r���zNamespaceReader.__init__����s+�������#�n�"5�5��^�,�,�#�T�.�%9�:�� r���c������������������J�����t��������|�j������������������j������������������|��������������S�r���r���r���s��� r ���r!���zNamespaceReader.resource_path����r"���r���c�����������������������|�j�������������������S�r���r$���r%���s��� r ���r&���zNamespaceReader.files����r'���r���Nr(���r,���r���r ���r����r��������s������;� 1�r���r����)r ���re���r���rc���rJ�����r���� _itertoolsr���r����TraversableResourcesr���r.����TraversablerN���r����r,���r���r ����<module>r�������sh�������������������9� ��)�)�� � 7��(�(��7�4F+�c�o�o��F+�R�c�.�.��r���