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/python38/lib/python3.8/site-packages/pip/_vendor/distlib/__pycache__/scripts.cpython-38.pyc
U

��e�F�@s�ddlmZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZmZm
Z
ddlmZddlmZmZmZmZmZmZe�e�Zd��Ze�d	�Zd
Zdd�ZeZ Gd
d�de!�Z"dS)�)�BytesION)�ZipInfo�)�	sysconfig�detect_encoding�ZipFile)�finder)�FileOperator�get_export_entry�convert_path�get_executable�get_platform�in_venva�
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
 <assemblyIdentity version="1.0.0.0"
 processorArchitecture="X86"
 name="%s"
 type="win32"/>

 <!-- Identify the application security requirements. -->
 <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
 <security>
 <requestedPrivileges>
 <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
 </requestedPrivileges>
 </security>
 </trustInfo>
</assembly>s^#!.*pythonw?[0-9.]*([ 	].*)?$z�# -*- coding: utf-8 -*-
import re
import sys
from %(module)s import %(import_name)s
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(%(func)s())
cCsXd|krT|�d�rB|�dd�\}}d|krT|�d�sTd||f}n|�d�sTd|}|S)N� z
/usr/bin/env r�"z%s "%s"z"%s")�
startswith�split)�
executable�env�_executable�r�?/tmp/pip-unpacked-wheel-uzdrexel/pip/_vendor/distlib/scripts.py�enquote_executable5s

rc@s�eZdZdZeZdZd*dd�Zdd�Ze	j
�d	�rBd
d�Zdd
�Z
dd�Zd+dd�Zdd�ZeZdd�Zdd�ZdZdd�Zd,dd�Zdd�Zed d!��Zejd"d!��Zejd#ks�ejd	kr�ejd#kr�d$d%�Zd-d&d'�Z d.d(d)�Z!dS)/�ScriptMakerz_
    A class to copy or create scripts from source scripts or callable
    specifications.
    NTFcCs�||_||_||_d|_d|_tjdkp:tjdko:tjdk|_t	d�|_
|pRt|�|_tjdkprtjdkortjdk|_
tj|_dS)NF�posix�java)��X.Y�nt)�
source_dir�
target_dir�
add_launchers�force�clobber�os�name�_name�set_mode�set�variantsr	�_fileop�_is_nt�sys�version_info)�selfrr r!�dry_run�fileoprrr�__init__Ps�

�zScriptMaker.__init__cCs@|�dd�r<|jr<tj�|�\}}|�dd�}tj�||�}|S)N�guiF�python�pythonw)�getr+r$�pathr�replace�join)r.r�options�dn�fnrrr�_get_alternate_executableas
z%ScriptMaker._get_alternate_executablerc
Cs\z0t|��}|�d�dkW5QR�WSQRXWn&ttfk
rVt�d|�YdSXdS)zl
            Determine if the specified executable is a script
            (contains a #! line)
            �z#!zFailed to open %sFN)�open�read�OSError�IOError�logger�warning)r.r�fprrr�	_is_shellis
&zScriptMaker._is_shellcCsD|�|�r*ddl}|jj�d�dkr<|Sn|���d�r<|Sd|S)Nrzos.name�Linuxz
jython.exez/usr/bin/env %s)rEr�lang�System�getProperty�lower�endswith)r.rrrrr�_fix_jython_executableus
z"ScriptMaker._fix_jython_executablecCs�tjdkrd}n8t|�t|�d}tjdkr4d}nd}d|koF||k}|r^d||d	}n d
}|d||d7}|d
7}|S)a
        Build a shebang line. In the simple case (on Windows, or a shebang line
        which is not too long or contains spaces) use a simple formulation for
        the shebang. Otherwise, use /bin/sh as the executable, with a contrived
        shebang which allows the script to run either under Python or sh, using
        suitable quoting. Thanks to Harald Nordgren for his input.

        See also: http://www.in-ulm.de/~mascheck/various/shebang/#length
                  https://hg.mozilla.org/mozilla-central/file/tip/mach
        rT��darwini�� s#!�
s
#!/bin/sh
s	'''exec' s "$0" "$@"
s' ''')r$r%�lenr,�platform)r.r�post_interp�simple_shebang�shebang_length�max_shebang_length�resultrrr�_build_shebang�s

�zScriptMaker._build_shebang�cCs~d}|jr|j}d}n�t��s&t�}nxt�rLtj�t�d�dt�	d��}nRtj�t�	d�dt�	d�t�	d�f�}tj�
|�s�tj�t�	d�dt�	d��}|r�|�||�}tj
�d	�r�|�|�}|r�t|�}|�d
�}tj
dkr�d|kr�d
|kr�|d7}|�||�}z|�d
�Wn"tk
�r8td|��YnX|d
k�rzz|�|�Wn&tk
�rxtd||f��YnX|S)NTF�scriptszpython%s�EXE�BINDIRz
python%s%s�VERSIONr�utf-8�cliz	-X:Framesz
-X:FullFramess
 -X:Framesz,The shebang (%r) is not decodable from utf-8z?The shebang (%r) is not decodable from the script encoding (%r))rr�is_python_buildrrr$r6r8�get_path�get_config_var�isfiler<r,rSrrLr�encoderY�decode�UnicodeDecodeError�
ValueError)r.�encodingrTr9�enquoter�shebangrrr�_get_shebang�s`�
���


��

��
zScriptMaker._get_shebangcCs$|jt|j|j�d�d|jd�S)N�.r)�module�import_name�func)�script_template�dict�prefix�suffixr)r.�entryrrr�_get_script_text�s
�zScriptMaker._get_script_textcCstj�|�}|j|S�N)r$r6�basename�manifest)r.�exename�baserrr�get_manifest�szScriptMaker.get_manifestcCs6|jo
|j}tj�d�}|�|�s*||7}|s8||}n�|dkrL|�d�}n
|�d�}t�}	t|	d��R}
tj	�
d�}|r�t�t
|��dd�}td|d�}
|
�|
|�n|
�d|�W5QRX|	��}|||}|D�]X}tj�|j|�}|�r�tj�|�\}}|�d	��r|}d
|}z|j�||�Wn�tk
�r�t�d�d|}tj�|��rht�|�t�||�|j�||�t�d
�zt�|�Wntk
�r�YnXYnXnl|j�r�|�d|��s�d||f}tj�|��r|j�st�d|�q�|j�||�|j �r&|j�!|g�|�"|�q�dS)Nr_�py�t�w�SOURCE_DATE_EPOCH�z__main__.py)�filename�	date_timez.pyz%s.exez:Failed to write executable - trying to use .deleteme logicz%s.deletemez0Able to replace executable using .deleteme logicrmz%s.%szSkipping existing file %s)#r!r+r$�lineseprerK�
_get_launcherrr�environr5�time�gmtime�intr�writestr�getvaluer6r8r �splitextrr*�write_binary_file�	ExceptionrBrC�exists�remove�rename�debugr#r'�set_executable_mode�append)r.�namesrk�script_bytes�	filenames�ext�use_launcherr��launcher�stream�zfZsource_date_epochr��zinfo�zip_datar%�outname�n�e�dfnamerrr�
_write_script�sb






zScriptMaker._write_script�-cCsnt�}d|jkr|�|�d|jkr<|�d||jdf�d|jkrj|�d||j|jd|jdf�|S)Nr�Xz%s%srrz	%s%s%s.%sr)r(r)�addr-�variant_separator)r.r%rXrrr�get_script_filenames,s



�z ScriptMaker.get_script_filenamesc
Cs�d}|r0|�dg�}|r0dd�|�}|�d�}|jd||d�}|�|��d�}|�|j�}|rr|�dd�rrd	}	nd
}	|�|||||	�dS)NrZ�interpreter_argsz %srr_�r9r2F�pywr})r5r8rerlrvr�r%r�)
r.rur�r9rT�argsrk�script�scriptnamesr�rrr�_make_script7s
zScriptMaker._make_scriptcCs�d}tj�|jt|��}tj�|jtj�|��}|jsT|j�	||�sTt
�d|�dSzt|d�}Wn t
k
r�|jsz�d}YnFX|��}|s�t
�d|�dSt�|�dd��}|r�d}|�d�p�d	}|�s|r�|��|j�||�|jr�|j�|g�|�|�n�t
�d
||j�|jj�s~t|j�\}	}
|�d�|�|	|�}d|k�rVd
}nd}tj�|�}
|�|
g||��||�|�r�|��dS)NFznot copying %s (up-to-date)�rbz%s is an empty file (skipping)s
rQTrrZzcopying and adjusting %s -> %srspythonwr�r}) r$r6r8rrr rxr"r*�newerrBr�r>rAr/�readlinerC�
FIRST_LINE_RE�matchr7�group�close�	copy_filer'r�r��infor�seekrlr�r?)r.r�r��adjustr��f�
first_liner�rTri�linesrkr�r�rrr�_copy_scriptGsR
�


zScriptMaker._copy_scriptcCs|jjSrw�r*r/)r.rrrr/zszScriptMaker.dry_runcCs||j_dSrwr�)r.�valuerrrr/~srcCstt�d�dkrd}nd}t�dkr&dnd}d|||f}t�d	d
�d}t|��|�}|snd||f}t|��|jS)
N�P�Z64Z32z	win-arm64z-armrz
%s%s%s.exermrrz(Unable to find resource %s in package %s)	�struct�calcsizer
�__name__�rsplitr�findrh�bytes)r.�kind�bitsZplatform_suffixr%Zdistlib_package�resource�msgrrrr��s�zScriptMaker._get_launchercCs6g}t|�}|dkr"|�||�n|j|||d�|S)a�
        Make a script.

        :param specification: The specification, which is either a valid export
                              entry specification (to make a script from a
                              callable) or a filename (to make a script by
                              copying from a source location).
        :param options: A dictionary of options controlling script generation.
        :return: A list of all absolute pathnames written to.
        Nr�)r
r�r�)r.�
specificationr9r�rurrr�make�szScriptMaker.makecCs$g}|D]}|�|�||��q|S)z�
        Take a list of specifications and make scripts from them,
        :param specifications: A list of specifications.
        :return: A list of all absolute pathnames written to,
        )�extendr�)r.�specificationsr9r�r�rrr�
make_multiple�szScriptMaker.make_multiple)TFN)rZN)N)N)N)"r��
__module__�__qualname__�__doc__�SCRIPT_TEMPLATErqrr1r<r,rSrrErLrYrlrv�_DEFAULT_MANIFESTryr|r�r�r�r�r��propertyr/�setterr$r%r&r�r�r�rrrrrGs:�

E:
3


r)#�ior�loggingr$�rer�r,r��zipfiler�compatrrr�	resourcesr�utilr	r
rrr
r�	getLoggerr�rB�stripr��compiler�r�r�_enquote_executable�objectrrrrr�<module>s"