HEX
Server: Apache
System: Linux sg2plmcpnl492417.prod.sin2.secureserver.net 4.18.0-553.58.1.lve.el8.x86_64 #1 SMP Fri Jul 4 12:07:06 UTC 2025 x86_64
User: nyiet8349bzl (9207396)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/cloudlinux/venv/lib/python3.11/site-packages/setuptools/__pycache__/_scripts.cpython-311.pyc
�

,|oi�+��z�ddlmZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddlm
Z
mZddlmZmZe
rddlmZddlmZdd	lmZdd
lmZGd�ded
���ZGd�de��ZGd�de��ZGd�d��ZGd�de��ZGd�de��Z d�Z!d�Z"d�Z#d�Z$d�Z%dS)�)�annotationsN)�Iterable)�
TYPE_CHECKING�	TypedDict�)�metadata�	resources)�Self)�SetuptoolsWarning)�
first_line_re)�get_platformc�$�eZdZUded<ded<dS)�
_SplitArgs�bool�comments�posixN)�__name__�
__module__�__qualname__�__annotations__���e/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/setuptools/_scripts.pyrrs"��������N�N�N��K�K�K�K�KrrF)�totalc��eZdZUdZgZded<e��Zed���Z	ed���Z
edd
���Zed���Zedd���Z
dd�Zed���Zd�Zed���Zed���ZdS)�CommandSpeczm
    A command spec for a #! header, specified as a list of arguments akin to
    those passed to Popen.
    z	list[str]�optionsc��|S)zV
        Choose the best CommandSpec class based on environmental conditions.
        r��clss r�bestzCommandSpec.best's	��
�
rc��tj�tj��}tj�d|��S)N�__PYVENV_LAUNCHER__)�os�path�normpath�sys�
executable�environ�get)r �_defaults  r�_sys_executablezCommandSpec._sys_executable.s0���7�#�#�C�N�3�3���z�~�~�3�X�>�>�>r�param�!Self | str | Iterable[str] | None�returnr
c�$�t||��r|St|t��r|�|��St|t��r||��S|�|���Stdt
|�������)zg
        Construct a CommandSpec from a parameter to build_scripts, which may
        be None.
        Nz!Argument has an unsupported type )�
isinstance�str�from_stringr�from_environment�	TypeError�type)r r-s  r�
from_paramzCommandSpec.from_param3s����e�S�!�!�	��L��e�S�!�!�	*��?�?�5�)�)�)��e�X�&�&�	��3�u�:�:���=��'�'�)�)�)��I�D��K�K�I�I�J�J�Jrc�>�||���g��S�N)r,rs rr4zCommandSpec.from_environmentCs!���s�C�'�'�)�)�*�+�+�+r�stringr2c�F�tj|fi|j��}||��S)z}
        Construct a command spec from a simple string representing a command
        line parseable by shlex.split.
        )�shlex�split�
split_args)r r:�itemss   rr3zCommandSpec.from_stringGs+����F�5�5�c�n�5�5���s�5�z�z�r�script_textc���tj|�|����|_t	j|��}t
|��sdg|jdd�<dSdS)Nz-xr)r<r=�_extract_optionsr�
subprocess�list2cmdline�isascii)�selfr@�cmdlines   r�install_optionszCommandSpec.install_optionsPsc���{�4�#8�#8��#E�#E�F�F����)�$�/�/���w���	&� $�v�D�L��!�����	&�	&rc���|dz���d}t���|��}|r|�d��pdnd}|���S)zH
        Extract any options from the first line of the script.
        �
rr�)�
splitlines�_first_line_re�match�group�strip)�orig_script�firstrNrs    rrBzCommandSpec._extract_optionsVsb��
�t�#�/�/�1�1�!�4��� � �&�&�u�-�-��*/�7�%�+�+�a�.�.�&�B��R���}�}���rc�V�|�|t|j��z��Sr9)�_render�listr)rFs r�	as_headerzCommandSpec.as_header`s#���|�|�D�4���#5�#5�5�6�6�6rc��d}|D]8}|�|��r!|�|��r|dd�cS�9|S)Nz"'r���)�
startswith�endswith)�item�_QUOTES�qs   r�
_strip_quoteszCommandSpec._strip_quotescsW�����	"�	"�A����q�!�!�
"�d�m�m�A�&6�&6�
"��A�b�D�z�!�!�!���rc�N�tjd�|D����}d|zdzS)Nc3�nK�|]0}t�|�����V��1dSr9)rr^rP)�.0r[s  r�	<genexpr>z&CommandSpec._render.<locals>.<genexpr>msI����*
�*
�8<�K�%�%�d�j�j�l�l�3�3�*
�*
�*
�*
�*
�*
rz#!rJ)rCrD)r?rGs  rrTzCommandSpec._renderksA���)�*
�*
�@E�*
�*
�*
�
�
���g�~��$�$rN)r-r.r/r
)r:r2r/r
)r@r2)rrr�__doc__rrrr>�classmethodr!r,r7r4r3rH�staticmethodrBrVr^rTrrrrrsE���������
�G���������J�����[���?�?��[�?��
K�
K�
K��[�
K��,�,��[�,������[��&�&�&�&�����\��7�7�7�����\���%�%��\�%�%�%rrc�&�eZdZed���ZdS)�WindowsCommandSpecF)rN)rrrrr>rrrrgrgss ��������%�(�(�(�J�J�Jrrgc���eZdZdZejd�����ZeZ	e
dd���Zed���Z
e
d���Ze
d���Ze
		ddd���ZdS)�ScriptWriterz`
    Encapsulates behavior around writing entry point scripts for console and
    gui apps.
    aJ
        # EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r
        import re
        import sys

        # for compatibility with easy_install; see #2198
        __requires__ = %(spec)r

        try:
            from importlib.metadata import distribution
        except ImportError:
            try:
                from importlib_metadata import distribution
            except ImportError:
                from pkg_resources import load_entry_point


        def importlib_load_entry_point(spec, group, name):
            dist_name, _, _ = spec.partition('==')
            matches = (
                entry_point
                for entry_point in distribution(dist_name).entry_points
                if entry_point.group == group and entry_point.name == name
            )
            return next(matches).load()


        globals().setdefault('load_entry_point', importlib_load_entry_point)


        if __name__ == '__main__':
            sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
            sys.exit(load_entry_point(%(spec)r, %(group)r, %(name)r)())
        Nc#��K�t|d��s8tjd��tj�|j��}|�|���}|j�d|j	��}dD]�}|�d�}|j
�|���D]^}|j}|�|j��|j
t��z}|�||j||��}	|	Ed{V���_��dS)z�
        Yield write_script() argument tuples for a distribution's
        console_scripts and gui_scripts entry points.
        �entry_pointsz%Unsupported distribution encountered.Nz==��console�gui�_scripts)rO)�hasattrr�emitr�Distribution�at�egg_info�
get_header�name�versionrk�select�_ensure_safe_name�template�locals�_get_script_args)
r �dist�header�spec�type_rO�eprvr@�argss
          r�get_argszScriptWriter.get_args�s�����t�^�,�,�	;��"�#J�K�K�K��(�+�+�D�M�:�:�D��>��^�^�%�%�F��)�-�-�t�|�-�-��%�	 �	 �E��&�&�&�E��'�.�.�U�.�;�;�
 �
 ���w���%�%�b�g�.�.�.�!�l�V�X�X�5���+�+�E�2�7�F�K�P�P�����������
 �	 �	 rc�R�tjd|��}|rtd���dS)z?
        Prevent paths in *_scripts entry point names.
        z[\\/]z+Path separators not allowed in script namesN)�re�search�
ValueError)rv�has_path_seps  rryzScriptWriter._ensure_safe_name�s9��
�y��4�0�0���	L��J�K�K�K�	L�	Lrc��tjdks tjdkr)tjdkrt
���S|S)zD
        Select the best ScriptWriter for this environment.
        �win32�java�nt)r'�platformr$rv�_name�WindowsScriptWriterr!rs rr!zScriptWriter.best�s@��
�<�7�"�"�r�w�&�'8�'8�R�X��=M�=M�&�+�+�-�-�-��Jrc#�K�|||zfV�dSr9r)r r�rvr~r@s     rr|zScriptWriter._get_script_args�s$�����V�k�)�*�*�*�*�*�*rrKr@r2r(�(str | CommandSpec | Iterable[str] | Noner/c��|j����|��}|�|��|���S)z;Create a #! line, getting options (if any) from script_text)�command_spec_classr!r7rHrV)r r@r(�cmds    rruzScriptWriter.get_header�sH���$�)�)�+�+�6�6�z�B�B�����K�(�(�(��}�}���rr9)rKN)r@r2r(r�r/r2)rrrrc�textwrap�dedent�lstriprzrr�rdr�reryr!r|rurrrririws���������
�x��!	�#�#�F
�f�h�h�G
�J%��� � � ��[� �0�L�L��\�L�����[���+�+��[�+���?C������[���rric�j�eZdZeZed���Zed���Zed���Ze	d���Z
dS)r�c�~�tt|���}tj�dd��}||S)zC
        Select the best ScriptWriter suitable for Windows
        )r(�natural�SETUPTOOLS_LAUNCHERr()�dict�WindowsExecutableLauncherWriterr$r)r*)r �
writer_lookup�launchers   rr!zWindowsScriptWriter.best�sA��
�6��
�
�
�
�
�:�>�>�"7��F�F���X�&�&rc#��K�tdd���|}|tjd����d��vr-djdit
����}tj|��gd�}|�	|��|�
||��}�fd�|D��}�|z||zd	|fV�d
S)z For Windows, add a .py extension�.pya�.pywrl�PATHEXT�;zK{ext} not listed in PATHEXT; scripts will not be recognized as executables.)r��.py�
-script.py�.pyc�.pyor��.exec���g|]}�|z��Srr�ra�xrvs  �r�
<listcomp>z8WindowsScriptWriter._get_script_args.<locals>.<listcomp>�����*�*�*��D�1�H�*�*�*r�tNr)r�r$r)�lowerr=�formatr{rrq�remove�_adjust_header)	r r�rvr~r@�ext�msg�old�blockerss	  `      rr|z$WindowsScriptWriter._get_script_args�s�������6�v�.�.�.�u�5���b�j��+�1�1�3�3�9�9�#�>�>�>�>��-��!�!��x�x�!�!�C�
�"�3�'�'�'�K�K�K���
�
�3�����#�#�E�6�2�2��*�*�*�*�c�*�*�*���S�j�&�;�.��X�=�=�=�=�=�=rc���d}d}|dkr||}}tjtj|��tj��}|�||���}|�|��r|n|S)z�
        Make sure 'pythonw' is used for gui and 'python' is used for
        console (regardless of what sys.executable is).
        zpythonw.exez
python.exern)r:�repl)r��compile�escape�
IGNORECASE�sub�_use_header)r r��orig_header�patternr��
pattern_ob�
new_headers       rr�z"WindowsScriptWriter._adjust_headersm�� �����E�>�>� �'�T�G��Z��	�'� 2� 2�B�M�B�B�
��^�^�;�T�^�B�B�
� �_�_�Z�8�8�I�z�z�k�Irc��|dd��d��}tjdkptj|��S)z�
        Should _adjust_header use the replaced header?

        On non-windows systems, always use. On
        Windows systems, only use the replaced header if it resolves
        to an executable on the system.
        �rX�"r�)rPr'r��shutil�which)r��clean_headers  rr�zWindowsScriptWriter._use_headers<��"�!�B�$�'�-�-�c�2�2���|�w�&�D�&�,�|�*D�*D�DrN)rrrrgr�rdr!r|r�rer�rrrr�r��s�������+���
'�
'��[�
'��
>�
>��[�
>��J�J��[�J��	E�	E��\�	E�	E�	Err�c�$�eZdZed���ZdS)r�c#��K�|dkrd}d}dg}nd}d}gd�}|�||��}�fd�|D��}	�|z||zd|	fV��d	zt|��d
fV�t��s�dz}
|
t���dfV�dSdS)
zG
        For Windows, add a .py extension and an .exe launcher
        rnz-script.pywr��clir�)r�r�r�c���g|]}�|z��Srrr�s  �rr�zDWindowsExecutableLauncherWriter._get_script_args.<locals>.<listcomp>+r�rr�r��bz
.exe.manifestN)r��get_win_launcher�is_64bit�load_launcher_manifest)r r�rvr~r@�
launcher_typer�r��hdrr��m_names  `        rr|z0WindowsExecutableLauncherWriter._get_script_argss������
�E�>�>�!�M��C��(�C�C�!�M��C�)�)�)�C�� � ���/�/��*�*�*�*�c�*�*�*���c�z�3��,�c�8�<�<�<�<��6�M��]�+�+��
�	
�	
�	
�
�z�z�	>��O�+�F��1�$�7�7��=�=�=�=�=�=�	>�	>rN)rrrrdr|rrrr�r�s-�������>�>��[�>�>�>rr�c�F�|�d�}t��r@t��dkr|�dd��}n-|�dd��}n|�dd��}tjd���|�����S)z�
    Load the Windows launcher (executable) suitable for launching a script.

    `type` should be either 'cli' or 'gui'

    Returns the executable as a byte string.
    r�z	win-arm64�.z-arm64.z-64.z-32.�
setuptools)r�r
�replacer	�files�joinpath�
read_bytes)r6�launcher_fns  rr�r�<s����-�-�-�K��z�z�7��>�>�[�(�(�%�-�-�c�9�=�=�K�K�%�-�-�c�6�:�:�K�K�!�)�)�#�v�6�6���?�<�(�(�1�1�+�>�>�I�I�K�K�Krc��tjt���d��}|�d���t��zS)Nzlauncher manifest.xmlzutf-8)�encoding)r	r�rr��	read_text�vars)rv�ress  rr�r�Os=��
�/�(�
#�
#�
,�
,�-D�
E�
E�C��=�=�'�=�*�*�T�V�V�3�3rc��ttjt��rtSt	jtj�����S)z_
    Return a regular expression based on first_line_re suitable for matching
    strings.
    )r1rr�r2r�r��decoderrrrMrMTs@��
�-�'��-�-�����:�m�+�2�2�4�4�5�5�5rc�2�tjd��dkS)N�P�)�struct�calcsizerrrr�r�`s���?�3���1�$�$rc�V�	|�d��n#t$rYdSwxYwdS)N�asciiFT)�encode�UnicodeError)�ss rrErEdsC���	��������������u�u������4s��
&�&)&�
__future__rr$r�r<r�r�rCr'r��collections.abcr�typingrr�
_importlibrr	�typing_extensionsr
�warningsr�distutils.command.build_scriptsr�distutils.utilr
rrUrrgrir�r�r�r�rMr�rErrr�<module>r�sj��"�"�"�"�"�"�	�	�	�	�	�	�	�	�����
�
�
�
�
�
�
�
�����
�
�
�
�����$�$�$�$�$�$�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+��'�&�&�&�&�&�&�'�'�'�'�'�'�9�9�9�9�9�9�'�'�'�'�'�'�������%�����
R%�R%�R%�R%�R%�$�R%�R%�R%�j)�)�)�)�)��)�)�)�g�g�g�g�g�g�g�g�T8E�8E�8E�8E�8E�,�8E�8E�8E�v>�>�>�>�>�&9�>�>�>�@L�L�L�&4�4�4�
	6�	6�	6�%�%�%�����r