| Server IP : 127.0.0.1 / Your IP : 216.73.216.109 Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10 System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64 User : SERVERWEB ( 0) PHP Version : 8.1.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/cygwin64/lib/python3.9/site-packages/pip/_vendor/distlib/__pycache__/ |
Upload File : |
a
X��e�G � @ s� d dl mZ d dlZd dlZd dlZd dlZd dlZd dlZd dlm Z ddl
mZmZm
Z
ddlmZ ddlmZmZmZmZmZmZ e�e�Zd�� Ze�d �Zd
Zdd� ZeZ G d
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())
c C sX d| v rT| � d�rB| �dd�\}}d|v rT|� 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_executable5 s
r c @ s� e Zd ZdZeZdZd*dd�Zdd� Ze j
�d �rBd
d� Zdd
� 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.
NTFc C s� || _ || _|| _d| _d| _tjdkp:tjdko:tjdk| _t d�| _
|pRt|�| _tjdkprtjdkortjdk| _
tj| _d S )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)�selfr r r �dry_runZfileopr r r �__init__R s �
�zScriptMaker.__init__c C s@ |� dd�r<| jr<tj�|�\}}|�dd�}tj�||�}|S )N�guiFZpythonZpythonw)�getr* r# �pathr �replace�join)r- r �optionsZdn�fnr r r �_get_alternate_executableg s
z%ScriptMaker._get_alternate_executabler c C sf z<t |�� }|�d�dkW d � W S 1 s00 Y W n$ ttfy` t�d|� Y dS 0 dS )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 �fpr r r � _is_shellp s
2zScriptMaker._is_shellc C sD | � |�r*dd l}|jj�d�dkr<|S n|�� �d�r<|S d| S )Nr zos.nameZLinuxz
jython.exez/usr/bin/env %s)r@ r �langZSystemZgetProperty�lower�endswith)r- r r r r r �_fix_jython_executable| s
z"ScriptMaker._fix_jython_executablec C s� t jdkrd}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
r T� �darwini � � s #!�
s
#!/bin/sh
s '''exec' s "$0" "$@"
s ' ''')r# r$ �lenr+ �platform)r- r �post_interpZsimple_shebangZshebang_lengthZmax_shebang_length�resultr r r �_build_shebang� s
�zScriptMaker._build_shebang� c C sz d}| j r| j }d}n�t�� s&t� }nxt� rLtj�t�d�dt� d� �}nRtj
dkrvtj�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� W n t�y6 td| ��Y n0 |dk�rvz|�|� W n$ t�yt td||f ��Y n0 |S )NTFZscriptszpython%sZEXEr ZBINDIRz
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))r r Zis_python_buildr r r# r2 r4 Zget_pathZget_config_varr$ r7 r+ rK r rD r �encoderN �decode�UnicodeDecodeError�
ValueError)r- �encodingrL r5 Zenquoter �shebangr r r �_get_shebang� s` �
�
��
��
�zScriptMaker._get_shebangc C s$ | j t|j|j�d�d |jd� S )N�.r )�moduleZimport_name�func)�script_template�dict�prefix�suffixr )r- �entryr r r �_get_script_text� s
�zScriptMaker._get_script_textc C s t j�|�}| j| S �N)r# r2 �basename�manifest)r- Zexename�baser r r �get_manifest� s zScriptMaker.get_manifestc C sF | j o
| j}tj�d�}|�|�s*||7 }|s8|| }n�|dkrL| �d�}n
| �d�}t� } t| d��\}
tj �
d�}|r�t�t
|��d d� }td|d�}
|
�|
|� n|
�d|� W d � n1 s�0 Y | �� }|| | }|D �]T}tj�| j|�}|�r�tj�|�\}}|�d ��r&|}d
| }z| j�||� W n� t�y� t�d� d| }tj�|��rzt�|� t�||� | j�||� t�d
� zt�|� W n t�y� Y n0 Y n0 nl| j�r�|�d| ��s�d||f }tj�|��r| j�st�d|� q�| j�||� | j �r6| j�!|g� |�"|� q�d S )NrP �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 logicrX z%s.%szSkipping existing file %s)#r r* r# �lineseprQ rC �
_get_launcherr r �environr1 �time�gmtime�intr Zwritestr�getvaluer2 r4 r �splitextr r) Zwrite_binary_file� Exceptionr= r>