Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 3.136.25.115
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : resources.cpython-312.pyc
�


fD*��.�ddlmZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddlm
Z
mZmZej e�ZdaGd�de�ZGd�d	e�ZGd
�de�ZGd�d
e�ZGd�de�ZGd�de�Zed�ee	j8eiZ		ddlZeeejD<eeejF<eeejH<[d�Z&iZ'd�Z(ejRe*d��Z+d�Z,y#e $rddl!ZY�]wxYw#e e%f$rY�<wxYw)�)�unicode_literalsN�)�DistlibException)�cached_property�get_cache_base�Cachec�,��eZdZd�fd�	Zd�Zd�Z�xZS)�
ResourceCachec���|�1tjjt�t	d��}t
t|�|�y)Nzresource-cache)�os�path�joinr�str�superr
�__init__)�self�base�	__class__s  ��H/usr/local/python-3.12/lib/python3.12/site-packages/distlib/resources.pyrzResourceCache.__init__s4����<��7�7�<�<�� 0�#�6F�2G�H�D�
�m�T�+�D�1�c��y)z�
        Is the cache stale for the given resource?

        :param resource: The :class:`Resource` being cached.
        :param path: The path of the resource in the cache.
        :return: True if the cache is stale.
        T��r�resourcer
s   r�is_stalezResourceCache.is_stale"s��rc�R�|jj|�\}}|�|}|Stjj	|j
|j
|�|�}tjj|�}tjj|�stj|�tjj|�sd}n|j||�}|r2t|d�5}|j|j�ddd�|S|S#1swY|SxYw)z�
        Get a resource into the cache,

        :param resource: A :class:`Resource` instance.
        :return: The pathname of the resource in the cache.
        NT�wb)�finder�get_cache_inforr
rr�
prefix_to_dir�dirname�isdir�makedirs�existsr�open�write�bytes)rr�prefixr
�resultr!�stale�fs        r�getzResourceCache.get-s��� ���5�5�h�?�����>��F��
��W�W�\�\�$�)�)�T�-?�-?��-G��N�F��g�g�o�o�f�-�G��7�7�=�=��)����G�$��7�7�>�>�&�)����
�
�h��5����&�$�'�,�1��G�G�H�N�N�+�,��
�v�
�,��
�s�4D�D&�N)�__name__�
__module__�__qualname__rrr,�
__classcell__�rs@rr
r
s���2�	�rr
c��eZdZd�Zy)�ResourceBasec� �||_||_yr-)r�name)rrr6s   rrzResourceBase.__init__Hs�������	rN)r.r/r0rrrrr4r4Gs��rr4c�J�eZdZdZdZd�Zed��Zed��Zed��Z	y)�Resourcez�
    A class representing an in-package resource, such as a data file. This is
    not normally instantiated by user code, but rather by a
    :class:`ResourceFinder` which manages the resource.
    Fc�8�|jj|�S)z�
        Get the resource as a stream.

        This is not a property to make it obvious that it returns a new stream
        each time.
        )r�
get_stream�rs r�	as_streamzResource.as_streamUs���{�{�%�%�d�+�+rc�L�t�
t�atj|�Sr-)�cacher
r,r;s r�	file_pathzResource.file_path^s���=�!�O�E��y�y���rc�8�|jj|�Sr-)r�	get_bytesr;s rr'zResource.byteses���{�{�$�$�T�*�*rc�8�|jj|�Sr-)r�get_sizer;s r�sizez
Resource.sizeis���{�{�#�#�D�)�)rN)
r.r/r0�__doc__�is_containerr<rr?r'rDrrrr8r8MsO���
�L�,������+��+��*��*rr8c� �eZdZdZed��Zy)�ResourceContainerTc�8�|jj|�Sr-)r�
get_resourcesr;s r�	resourceszResourceContainer.resourcesqs���{�{�(�(��.�.rN)r.r/r0rFrrKrrrrHrHns���L��/��/rrHc���eZdZdZej
j
d�rdZndZd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Zeej*j,�Zd�Zy)�ResourceFinderz4
    Resource finder for file system resources.
    �java)�.pyc�.pyoz.class)rOrPc��||_t|dd�|_tjjt|dd��|_y)N�
__loader__�__file__�)�module�getattr�loaderrr
r!r)rrUs  rrzResourceFinder.__init__�s6������f�l�D�9����G�G�O�O�G�F�J��$C�D��	rc�@�tjj|�Sr-)rr
�realpath�rr
s  r�_adjust_pathzResourceFinder._adjust_path�s���w�w����%�%rc���t|t�rd}nd}|j|�}|jd|j�tjj|�}|j|�S)N�/�/r)	�
isinstancer'�split�insertrrr
rr[)r�
resource_name�sep�partsr)s     r�
_make_pathzResourceFinder._make_path�s]���m�U�+��C��C��#�#�C�(��
���Q��	�	�"������u�%��� � ��(�(rc�@�tjj|�Sr-)rr
r$rZs  r�_findzResourceFinder._find�s���w�w�~�~�d�#�#rc��d|jfSr-)r
�rrs  rrzResourceFinder.get_cache_info�s���X�]�]�"�"rc��|j|�}|j|�sd}|S|j|�r
t||�}nt	||�}||_|Sr-)rerg�
_is_directoryrHr8r
)rrbr
r)s    r�findzResourceFinder.find�s\�����}�-���z�z�$���F��
��!�!�$�'�*�4��?��!�$�
�6���F�K��
rc�.�t|jd�S�N�rb)r%r
ris  rr:zResourceFinder.get_stream�s���H�M�M�4�(�(rc�z�t|jd�5}|j�cddd�S#1swYyxYwrn)r%r
�read)rrr+s   rrAzResourceFinder.get_bytes�s0��
�(�-�-��
&�	�!��6�6�8�	�	�	�s�1�:c�T�tjj|j�Sr-)rr
�getsizeris  rrCzResourceFinder.get_size�s���w�w���x�}�}�-�-rc����fd�}ttj|j�D�cgc]
}||�s�|��c}�Scc}w)Nc�J��|dk7xr|j�j�S)N�__pycache__)�endswith�skipped_extensions)r+rs �r�allowedz-ResourceFinder.get_resources.<locals>.allowed�s,�����&�8��J�J�t�6�6�7�,8�
9r)�setr�listdirr
)rrryr+s`   rrJzResourceFinder.get_resources�s6���	9��r�z�z�(�-�-�8�G�!�G�A�J�A�G�H�H��Gs
�
A�Ac�8�|j|j�Sr-)rkr
ris  rrFzResourceFinder.is_container�s���!�!�(�-�-�0�0rc#�XK�|j|�}|��|g}|r�|jd�}|��|jrh|j}|jD]M}|s|}ndj||g�}|j|�}|jr|j
|��J|���O|r��yyy�w)Nrr^)rl�poprFr6rKr�append)rrbr�todo�rnamer6�new_name�childs        r�iteratorzResourceFinder.iterator�s������9�9�]�+�����:�D���8�8�A�;�����(�(�$�M�M�E� (� 2� 2�	(��$�'+�H�'*�x�x���
�'>�H� $�	�	�(� 3�� �-�-� �K�K��.�"'�K�	(�� �s�B$B*�'B*N)r.r/r0rE�sys�platform�
startswithrxrr[rergrrlr:rArCrJrF�staticmethodrr
r"rkr�rrrrMrMvsy����|�|���v�&�7��-��E�
&�
)�$�#�
�)��.�I�1�!������/�M�(rrMc�R��eZdZdZ�fd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Z�xZ
S)�ZipResourceFinderz6
    Resource finder for resources in .zip files.
    c�F��tt|�|�|jj}dt|�z|_t|jd�r|jj|_ntj||_t|j�|_y)Nr�_files)
rr�rrW�archive�len�
prefix_len�hasattrr��	zipimport�_zip_directory_cache�sorted�index)rrUr�rs   �rrzZipResourceFinder.__init__�ss���
���/��7��+�+�%�%���c�'�l�*����4�;�;��)��+�+�,�,�D�K�#�8�8��A�D�K��D�K�K�(��
rc��|Sr-rrZs  rr[zZipResourceFinder._adjust_path�s���rc���||jd}||jvrd}nj|r)|dtjk7r|tjz}t	j|j
|�}	|j
|j
|�}|s-tjd||jj�|Stjd||jj�|S#t$rd}Y�iwxYw)NT���Fz_find failed: %r %rz_find worked: %r %r)r�r�rrc�bisectr�r��
IndexError�logger�debugrWr()rr
r)�is    rrgzZipResourceFinder._find�s����D�O�O�$�%���4�;�;���F���R��B�F�F�*��b�f�f�}���
�
�d�j�j�$�/�A�
����A��1�1�$�7����L�L�.��d�k�k�6H�6H�I��
�
�L�L�.��d�k�k�6H�6H�I��
��
�
���
�s�-C'�'C5�4C5c�l�|jj}|jdt|�zd}||fS)Nr)rWr�r
r�)rrr(r
s    rrz ZipResourceFinder.get_cache_info�s4�����$�$���}�}�Q��V��_�-�.���t�|�rc�L�|jj|j�Sr-)rW�get_datar
ris  rrAzZipResourceFinder.get_bytes�s���{�{�#�#�H�M�M�2�2rc�J�tj|j|��Sr-)�io�BytesIOrAris  rr:zZipResourceFinder.get_stream�s���z�z�$�.�.��2�3�3rc�X�|j|jd}|j|dS)N�)r
r�r�rs   rrCzZipResourceFinder.get_size�s+���}�}�T�_�_�-�.���{�{�4� ��#�#rc�.�|j|jd}|r)|dtjk7r|tjz
}t	|�}t�}t
j|j|�}|t	|j�kr�|j|j|�s	|S|j||d}|j|jtjd�d�|dz
}|t	|j�kr��|S)Nr�rr)r
r�rrcr�rzr�r�r��addr`)rrr
�plenr)r��ss       rrJzZipResourceFinder.get_resourcess����}�}�T�_�_�-�.���D��H����&��B�F�F�N�D��4�y������M�M�$�*�*�d�+���#�d�j�j�/�!��:�:�a�=�+�+�D�1���
��
�
�1�
�d�e�$�A��J�J�q�w�w�r�v�v�q�)�!�,�-�
��F�A��#�d�j�j�/�!��
rc��||jd}|r)|dtjk7r|tjz
}tj|j|�}	|j|j|�}|S#t$rd}Y|SwxYw)Nr�F)r�rrcr�r�r�r�)rr
r�r)s    rrkzZipResourceFinder._is_directorys����D�O�O�$�%���D��H����&��B�F�F�N�D��M�M�$�*�*�d�+��	��Z�Z��]�-�-�d�3�F��
���	��F��
�	�s�A<�<B�
B)r.r/r0rErr[rgrrAr:rCrJrkr1r2s@rr�r��s5����	)���$�
3�4�$�
�	rr�c�(�|tt|�<yr-)�_finder_registry�type)rW�finder_makers  r�register_finderr�2s��%1��T�&�\�"rc�X�|tvrt|}|S|tjvrt|�tj|}t	|dd�}|�td��t	|dd�}tjt|��}|�td|z��||�}|t|<|S)z�
    Return a resource finder for a package.
    :param package: The name of the package.
    :return: A :class:`ResourceFinder` instance for the package.
    �__path__Nz8You cannot get a finder for a module, only for a packagerRzUnable to locate finder for %r)	�
_finder_cacher��modules�
__import__rVrr�r,r�)�packager)rUr
rWr�s      rrr9s����-���w�'���M��#�+�+�%��w�����W�%���v�z�4�0���<�"�$8�9�
9����t�4��'�+�+�D��L�9����"�#C�g�#M�N�N��f�%��!'�
�g���Mr�	__dummy__c�&�d}tj|�tjj	|�}t
j	t
|��}|r:t}tjj|d�|_||_||�}|S)z�
    Return a resource finder for a path, which should represent a container.

    :param path: The path.
    :return: A :class:`ResourceFinder` instance for the path.
    NrT)
�pkgutil�get_importerr��path_importer_cacher,r�r��
_dummy_modulerr
rrSrR)r
r)rWrrUs     r�finder_for_pathr�Usu���F������
�
$�
$�
(�
(��
.�F�
�
!�
!�$�v�,�
/�F�
����'�'�,�,�t�R�0���"��������Mr)-�
__future__rr�r��loggingrr�r��typesr�rTr�utilrrr�	getLoggerr.r�r>r
�objectr4r8rHrMr�r��zipimporterr��_frozen_importlib_external�_fi�ImportError�_frozen_importlib�SourceFileLoader�
FileFinder�SourcelessFileLoader�AttributeErrorr�r�r�
ModuleTyperr�r�rrr�<module>r�sR��(�
�	��	��
����8�8�	��	�	�8�	$��	
��)�E�)�X�6��*�|�*�B/��/�W(�V�W(�tK��K�^	��J��
���,���
	�(�0�.<��S�)�)�*�'5��S�^�^�$�1?��S�-�-�.��
2��
��2!�� � ��[�!1�2�
���]�(�'�(��	�^�$�	��	�s0�%C;�).D
�;	D�D
�D�D
�
D�D
© 2025 GrazzMean