HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/lib/python3.9/site-packages/pip/_vendor/distlib/__pycache__/scripts.cpython-39.pyc
a

?�fC�@s�ddlmZddlZddlZddlZddlZddlZddlmZm	Z	m
Z
ddlmZddl
mZmZmZmZmZe�e�Zd��Ze�d�Zd	Zd
d�ZeZGdd
�d
e�ZdS)�)�BytesION�)�	sysconfig�detect_encoding�ZipFile)�finder)�FileOperator�get_export_entry�convert_path�get_executable�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|vrT|�d�rB|�dd�\}}d|vrT|�d�sTd||f}n|�d�sTd|}|S)N� z
/usr/bin/env r�"z%s "%s"z"%s")�
startswith�split)�
executable�envZ_executable�r�?/usr/lib/python3.9/site-packages/pip/_vendor/distlib/scripts.py�enquote_executable3s

rc@s�eZdZdZeZdZd'dd�Zdd�Ze	j
�d	�rBd
d�Zdd
�Z
dd�Zd(dd�Zdd�ZeZdd�Zdd�Zd)dd�Zdd�Zedd��Zejdd��Zejd ks�ejd	kr�ejd kr�d!d"�Zd*d#d$�Zd+d%d&�ZdS),�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)�selfrrr�dry_runZfileoprrr�__init__Ns�

�zScriptMaker.__init__cCs@|�dd�r<|jr<tj�|�\}}|�dd�}tj�||�}|S)N�guiFZpythonZpythonw)�getr(r!�pathr�replace�join)r+r�optionsZdn�fnrrr�_get_alternate_executable_s
z%ScriptMaker._get_alternate_executablerc	Csfz<t|�� }|�d�dkWd�WS1s00YWn$ttfy`t�d|�YdS0dS)zl
            Determine if the specified executable is a script
            (contains a #! line)
            �z#!NzFailed to open %sF)�open�read�OSError�IOError�logger�warning)r+r�fprrr�	_is_shellgs
2zScriptMaker._is_shellcCsD|�|�r*ddl}|jj�d�dkr<|Sn|���d�r<|Sd|S)Nrzos.nameZLinuxz
jython.exez/usr/bin/env %s)r>rZlangZSystemZgetProperty�lower�endswith)r+rrrrr�_fix_jython_executabless
z"ScriptMaker._fix_jython_executablecCs�tjdkrd}n8t|�t|�d}tjdkr4d}nd}d|voF||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_interpZsimple_shebangZshebang_lengthZmax_shebang_length�resultrrr�_build_shebangs

�zScriptMaker._build_shebang�cCsPd}|jr|j}d}n^t��s&t�}nNt�rLtj�t�d�dt�	d��}n(tj�t�	d�dt�	d�t�	d�f�}|r�|�
||�}tj�
d	�r�|�|�}|r�t|�}|�d
�}tjdkr�d|vr�d
|vr�|d7}|�||�}z|�d
�Wn t�ytd|��Yn0|d
k�rLz|�|�Wn$t�yJtd||f��Yn0|S)NTFZscriptszpython%sZEXEZBINDIRz
python%s%sZVERSIONr�utf-8Zcliz	-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))rrZis_python_buildrrr!r0r2Zget_pathZget_config_varr5r)rHrrAr�encoderK�decode�UnicodeDecodeError�
ValueError)r+�encodingrIr3Zenquoter�shebangrrr�_get_shebang�sX�
��


��

��
zScriptMaker._get_shebangcCs$|jt|j|j�d�d|jd�S)N�.r)�moduleZimport_name�func)�script_template�dict�prefix�suffixr)r+�entryrrr�_get_script_text�s
�zScriptMaker._get_script_textcCstj�|�}|j|S�N)r!r0�basename�manifest)r+Zexename�baserrr�get_manifest�szScriptMaker.get_manifestcCs|jo
|j}tj�d�}|�|�s*||7}|s8||}nn|dkrL|�d�}n
|�d�}t�}	t|	d��}
|
�	d|�Wd�n1s�0Y|	�
�}|||}|D�]R}tj�|j
|�}
|�r�tj�|
�\}}|�d�r�|}
d|
}
z|j�|
|�Wn�t�y�t�d�d	|
}tj�|��r8t�|�t�|
|�|j�|
|�t�d
�zt�|�Wnt�y~Yn0Yn0nl|j�r�|
�d|��s�d|
|f}
tj�|
��r�|j�s�t�d
|
�q�|j�|
|�|j�r�|j�|
g�|�|
�q�dS)NrM�py�t�wz__main__.pyz.pyz%s.exez:Failed to write executable - trying to use .deleteme logicz%s.deletemez0Able to replace executable using .deleteme logicrUz%s.%szSkipping existing file %s)rr(r!�lineseprNr@�
_get_launcherrrZwritestr�getvaluer0r2r�splitextrr'Zwrite_binary_file�	Exceptionr;r<�exists�remove�rename�debugr r$�set_executable_mode�append)r+�namesrSZscript_bytes�	filenames�extZuse_launcherrfZlauncher�streamZzfZzip_datar"�outname�n�eZdfnamerrr�
_write_script�sX


*




zScriptMaker._write_scriptcCs�d}|r0|�dg�}|r0dd�|�}|�d�}|jd||d�}|�|��d�}|j}t�}	d|jvrp|	�|�d|jvr�|	�d	||j	d
f�d|jvr�|	�d||j	d
|j	d
f�|r�|�dd�r�d}
nd}
|�
|	||||
�dS)NrLZinterpreter_argsz %sr
rM�r3r�Xz%s%srrz%s-%s.%srr.F�pywrc)r/r2rNrTr]r"r%r&�addr*rx)r+r\rrr3rI�argsrS�scriptr"Zscriptnamesrsrrr�_make_scripts,




�zScriptMaker._make_scriptcCs�d}tj�|jt|��}tj�|jtj�|��}|jsT|j�	||�sTt
�d|�dSzt|d�}Wnt
y�|jsx�d}YnL0|��}|s�t
�d|��|�dSt�|�dd��}|r�d}|�d�p�d	}|�s|r�|��|j�||�|j�r|j�|g�|�|�n�t
�d
||j�|jj�s�t|j�\}	}
|�d�|�|	|�}d|v�r\d
}nd}tj�|�}
|�|
g||� �||�|�r�|��dS)NFznot copying %s (up-to-date)�rbz"%s: %s is an empty file (skipping)s
rFTrrLzcopying and adjusting %s -> %srspythonwr{rc)!r!r0r2rr
rr_rr'Znewerr;rnr7r:r,�readliner<Zget_command_name�
FIRST_LINE_RE�matchr1�group�closeZ	copy_filer$rorp�infor�seekrTrxr8)r+r~rrZadjustru�fZ
first_liner�rIrR�linesrSrsrvrrr�_copy_script5sV
��


zScriptMaker._copy_scriptcCs|jjSr^�r'r,)r+rrrr,iszScriptMaker.dry_runcCs||j_dSr^r�)r+�valuerrrr,msrcCs`t�d�dkrd}nd}d||f}t�dd�d}t|��|�}|sZd	||f}t|��|jS)
N�P�Z64Z32z%s%s.exerUrrz(Unable to find resource %s in package %s)�struct�calcsize�__name__�rsplitr�findrQ�bytes)r+�kind�bitsr"Zdistlib_package�resource�msgrrrrgus�zScriptMaker._get_launchercCs6g}t|�}|dur"|�||�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.
        Nry)r	r�r)r+�
specificationr3rrr\rrr�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+Zspecificationsr3rrr�rrr�
make_multiple�szScriptMaker.make_multiple)TFN)rLN)N)N)N) r��
__module__�__qualname__�__doc__�SCRIPT_TEMPLATErXrr-r5r)rHrr>rArKrTr]�_DEFAULT_MANIFESTr`rbrxrr��propertyr,�setterr!r"r#rgr�r�rrrrrEs4�

@4
4


r)�iorZloggingr!�rer�r)�compatrrrZ	resourcesr�utilrr	r
rrZ	getLoggerr�r;�stripr��compiler�r�rZ_enquote_executable�objectrrrrr�<module>s