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.17.131.133
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : manifest.cpython-312.pyc
�


fX7��@�dZddlZddlZddlZddlZddlZddlmZddlm	Z	ddl
mZdgZeje�Zej dej"�Zej d	ej"ej&z�Zej*dd
ZGd�de�Zy)zu
Class representing the list of files in a distribution.

Equivalent to distutils.filelist, but fixes some problems.
�N�)�DistlibException)�fsdecode)�convert_path�Manifestz\\w*
z#.*?(?=
)|
(?=$)�c�n�eZdZdZdd�Zd�Zd�Zd�Zdd�Zd�Z	d	�Z
d
�Z		dd�Z		dd�Z
		dd
�Zd�Zy)rz�
    A list of files built by exploring the filesystem and filtered by applying various
    patterns to what we find there.
    Nc�"�tjjtjj|xstj���|_|j
tjz|_d|_t�|_
y)zd
        Initialise an instance.

        :param base: The base directory to explore under.
        N)�os�path�abspath�normpath�getcwd�base�sep�prefix�allfiles�set�files)�selfrs  �G/usr/local/python-3.12/lib/python3.12/site-packages/distlib/manifest.py�__init__zManifest.__init__,sV���G�G�O�O�B�G�G�$4�$4�T�5H�R�Y�Y�[�$I�J��	��i�i�"�&�&�(�����
��U��
�c���ddlm}m}m}gx|_}|j
}|g}|j}|j}|r�|�}tj|�}	|	D]�}
tjj||
�}tj|�}|j}
||
�r|jt|���g||
�s�p||
�r�y||���|r��yy)zmFind all files under the base and set ``allfiles`` to the absolute
        pathnames of files found.
        r)�S_ISREG�S_ISDIR�S_ISLNKN)�statrrrrr�pop�appendr�listdirr�join�st_moder)rrrrr�root�stackr�push�names�name�fullnamer�modes              r�findallzManifest.findall;s���	3�2�#%�%��
���y�y������i�i���|�|����5�D��J�J�t�$�E��	
#���7�7�<�<��d�3���w�w�x�(���|�|���4�=��O�O�H�X�$6�7��T�]�7�4�=���N�	
#�	rc��|j|j�s*tjj	|j
|�}|jjtjj|��y)zz
        Add a file to the manifest.

        :param item: The pathname to add. This can be relative to the base.
        N)	�
startswithrrrr"rr�addr)r�items  rr.zManifest.addVsK�����t�{�{�+��7�7�<�<��	�	�4�0�D��
�
���r�w�w�'�'��-�.rc�4�|D]}|j|��y)z�
        Add a list of files to the manifest.

        :param items: The pathnames to add. These can be relative to the base.
        N)r.)r�itemsr/s   r�add_manyzManifest.add_many`s���	�D��H�H�T�N�	rc�6�����fd��t�j�}|r<t�}|D](}�|tjj	|���*||z}td�|D��D�cgc]}tjj|��� c}Scc}w)z8
        Return sorted files in directory order
        c����|j|�tjd|�|�jk7r2tj
j
|�\}}|dvsJ��||�yy)Nzadd_dir added %s)��/)r.�logger�debugrrr�split)�dirs�d�parent�_�add_dirrs    ��rr>z Manifest.sorted.<locals>.add_dirns[����H�H�Q�K��L�L�+�Q�/��D�I�I�~��G�G�M�M�!�,�	����Y�.�.�.���f�%�rc3�ZK�|]#}tjj|����%y�w�N)rrr9)�.0rs  r�	<genexpr>z"Manifest.sorted.<locals>.<genexpr>}s����>�t�r�w�w�}�}�T�*�>�s�)+)rrrr�dirname�sortedr")r�wantdirs�resultr:�f�
path_tupler>s`     @rrDzManifest.sortedis����
	&��T�Z�Z�����5�D��
2����b�g�g�o�o�a�0�1�
2��d�N�F��>�v�>�>�@�j������j�)�@�	@��@s�0#Bc�0�t�|_g|_y)zClear all collected files.N)rrr)rs r�clearzManifest.clears���U��
���
rc��|j|�\}}}}|dk(r2|D],}|j|d��r�tjd|��.y|dk(r|D]}|j	|d���y|dk(r2|D],}|j|d��r�tjd|��.y|d	k(r|D]}|j	|d���y|d
k(r3|D]-}|j||��r�tjd||��/y|d
k(r|D]}|j	||���y|dk(r+|jd|��stjd|�yy|dk(r+|j	d|��stjd|�yytd|z��)av
        Process a directive which either adds some files from ``allfiles`` to
        ``files``, or removes some files from ``files``.

        :param directive: The directive to process. This should be in a format
                     compatible with distutils ``MANIFEST.in`` files:

                     http://docs.python.org/distutils/sourcedist.html#commands
        �includeT)�anchorzno files found matching %r�exclude�global-includeFz3no files found matching %r anywhere in distribution�global-exclude�recursive-include)rz-no files found matching %r under directory %r�recursive-exclude�graftNz no directories found matching %r�prunez4no previously-included directories found matching %rzinvalid action %r)�_parse_directive�_include_patternr7�warning�_exclude_patternr)r�	directive�action�patterns�thedir�
dirpattern�patterns       r�process_directivezManifest.process_directive�s���04�/D�/D�Y�/O�,���&�*�
�Y��#�
J���,�,�W�T�,�B��N�N�#?��I�
J��y�
 �#�
<���%�%�g�d�%�;�
<��'�
'�#�
H���,�,�W�U�,�C��N�N�$>�?F�H�
H�
�'�
'�#�
=���%�%�g�e�%�<�
=��*�
*�#�
J���,�,�W�V�,�D��N�N�$8�9@�&�J�
J�
�*�
*�#�
>���%�%�g�f�%�=�
>��w�
��(�(��j�(�A����A�)�+�B��w�
��(�(��j�(�A���� -�.8�:�B�#�#�f�,�.�
.rc�,�|j�}t|�dk(r|ddvr|jdd�|d}dx}x}}|dvr8t|�dkrtd|z��|ddD�cgc]
}t	|���}}n�|d	vrFt|�d
krtd|z��t	|d�}|ddD�cgc]
}t	|���}}n=|dvr+t|�dk7rtd
|z��t	|d�}ntd|z��||||fScc}wcc}w)z�
        Validate a directive.
        :param directive: The directive to validate.
        :return: A tuple of action, patterns, thedir, dir_patterns
        rr)rLrNrOrPrQrRrSrTrLN)rLrNrOrPrz$%r expects <pattern1> <pattern2> ...)rQrR�z*%r expects <dir> <pattern1> <pattern2> ...)rSrTz!%r expects a single <dir_pattern>zunknown action %r)r9�len�insertrr)rrY�wordsrZr[r\�dir_pattern�words        rrUzManifest._parse_directive�sf�����!���u�:��?�u�Q�x�0B� B�
�L�L��I�&��q���*.�.��.�6�K��:�:��5�z�A�~�&�:�V�C�E�E�8=�Q�R�y�A�t��T�*�A�H�A�
�A�
A��5�z�A�~�&�@�6�I�K�K�"�%��(�+�F�7<�Q�R�y�A�t��T�*�A�H�A�
�)�
)��5�z�Q��&�7�&�@�B�B�'�u�Q�x�0�K�#�#6��#?�@�@��x���4�4��)B��Bs�*D�4Dc���d}|j||||�}|j�|j�|jD]1}|j|�s�|jj|�d}�3|S)a�Select strings (presumably filenames) from 'self.files' that
        match 'pattern', a Unix-style wildcard (glob) pattern.

        Patterns are not quite the same as implemented by the 'fnmatch'
        module: '*' and '?'  match non-special characters, where "special"
        is platform-dependent: slash on Unix; colon, slash, and backslash on
        DOS/Windows; and colon on Mac OS.

        If 'anchor' is true (the default), then the pattern match is more
        stringent: "*.py" will match "foo.py" but not "foo/bar.py".  If
        'anchor' is false, both of these will match.

        If 'prefix' is supplied, then only filenames starting with 'prefix'
        (itself a pattern) and ending with 'pattern', with anything in between
        them, will match.  'anchor' is ignored in this case.

        If 'is_regex' is true, 'anchor' and 'prefix' are ignored, and
        'pattern' is assumed to be either a string containing a regex or a
        regex object -- no translation is done, the regex is just compiled
        and used as-is.

        Selected strings will be added to self.files.

        Return True if files are found.
        FT)�_translate_patternrr+�searchrr.)rr^rMr�is_regex�found�
pattern_rer(s        rrVzManifest._include_pattern�sq��8���,�,�W�f�f�h�O�
��=�=� ��L�L�N��M�M�	�D�� � ��&��
�
���t�$���	��rc���d}|j||||�}t|j�D]1}|j|�s�|jj	|�d}�3|S)atRemove strings (presumably filenames) from 'files' that match
        'pattern'.

        Other parameters are the same as for 'include_pattern()', above.
        The list 'self.files' is modified in place. Return True if files are
        found.

        This API is public to allow e.g. exclusion of SCM subdirs, e.g. when
        packaging source distributions
        FT)rh�listrri�remove)rr^rMrrjrkrlrGs        rrXzManifest._exclude_pattern sc�����,�,�W�f�f�h�O�
��d�j�j�!�	�A�� � ��#��
�
�!�!�!�$���	��rc�J�|r't|t�rtj|�S|StdkDr$|jd�j
d�\}}}|r>|j|�}tdkDr&|j�r|j�sJ�d}tjtjj|jd��}	|��tdkr0|jd�}
|j|�dt|
�}nX|j|�}|j�r|j�sJ�|t|�t|�t|�z
}tj}tjdk(rd}tdkrd|	z|j|d|zf�z}n[|t�t|�t�z
}|�|	�|�|�d|�|��}n(|r&tdkr	d|	z|z}n�|	�|t|�d��}tj|�S)	aTranslate a shell-like wildcard pattern to a compiled regular
        expression.

        Return the compiled regex.  If 'is_regex' true,
        then 'pattern' is directly compiled to a regex (if it's a string)
        or just returned as-is (assumes it's a regex object).
        )rarr=r5N�\z\\�^z.*)�
isinstance�str�re�compile�_PYTHON_VERSION�_glob_to_re�	partitionr-�endswith�escaperrr"rrbr)
rr^rMrrj�startr=�endrlr�
empty_pattern�	prefix_rers
             rrhzManifest._translate_pattern4s�����'�3�'��z�z�'�*�*����V�#� �,�,�S�1�;�;�C�@�M�E�1�c���)�)�'�2�J���'�!�,�,�U�3�
�8K�8K�C�8P�P�P��J��y�y������d�i�i��4�5�����&�(� $� 0� 0�� 4�
� �,�,�V�4�5I�s�=�7I�6I�J�	� �,�,�V�4�	� �+�+�E�2�y�7I�7I�#�7N�N�N�%�c�%�j�#�i�.�3�s�8�2K�L�	��&�&�C��v�v��~����&�(� �4�Z�#�(�(�I�48�:�4E�4G�+H�H�
�(��E�
�C�
�O�c�#�h�4N�O�
�27��y�#�2<�c�C�
��"�f�,�!$�t��j�!8�J�.3�T�:�c�%�j�k�;R�!S�J��z�z�*�%�%rc��tj|�}tj}tjdk(rd}d|z}t	j
d||�}|S)z�Translate a shell-like glob pattern to a regular expression.

        Return a string containing the regex.  Differs from
        'fnmatch.translate()' in that '*' does not match "special characters"
        (which are platform-specific).
        rqz\\\\z\1[^%s]z((?<!\\)(\\\\)*)\.)�fnmatch�	translaterrru�sub)rr^rlr�escapeds     rrxzManifest._glob_to_reksT���&�&�w�/�
��f�f��
�6�6�T�>��C��s�"���V�V�1�7�J�G�
��rr@)F)TNF)�__name__�
__module__�__qualname__�__doc__rr+r.r2rDrJr_rUrVrXrhrx�rrrr&sc���
	�#�6/��@�,�
>.�H-5�^=A�"'�'�R=A�"'��(?C�$)�5&�nr)r�r��loggingrru�sysr5r�compatr�utilr�__all__�	getLoggerr�r7rv�M�_COLLAPSE_PATTERN�S�_COMMENTED_LINE�version_inforw�objectrr�rr�<module>r�s����
��	�	�
�����,��	��	�	�8�	$���B�J�J�z�2�4�4�0���"�*�*�1�2�4�4�"�$�$�;�?���"�"�2�A�&��Z�v�Zr
© 2025 GrazzMean