ok

Mini Shell

Direktori : /proc/self/root/opt/alt/python37/lib64/python3.7/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python37/lib64/python3.7/__pycache__/zipapp.cpython-37.opt-2.pyc

B

0��co�@s�ddlZddlZddlZddlZddlZddlZddlZdddgZdZej	�
d�rXdZne��ZGdd�de
�Zejd	d
��Zdd�Zdd
d�Zddd�Zdd�Zddd�Zedkr�e�dS)�N�ZipAppError�create_archive�get_interpreterz8# -*- coding: utf-8 -*-
import {module}
{module}.{fn}()
�winzutf-8c@seZdZdS)rN)�__name__�
__module__�__qualname__�r	r	�+/opt/alt/python37/lib64/python3.7/zipapp.pyr!sc	cs8t|ttjf�r.t||��}|VWdQRXn|VdS)N)�
isinstance�str�os�PathLike�open)�archive�mode�fr	r	r
�_maybe_open%srcCs$|r d|�t�d}|�|�dS)Ns#!�
)�encode�shebang_encoding�write)r�interpreterZshebangr	r	r
�_write_file_prefix.src
Cs�t|d��Z}|�d�}|dkr*d}|��t|d��&}t||�|�|�t�||�WdQRXWdQRX|r�t|t�r�t	�
|t	�|�jtj
B�dS)N�rb�s#!��wb)r�read�readlinerr�shutilZcopyfileobjrrr
�chmod�stat�st_mode�S_IEXEC)rZnew_archiver�srcZfirst_2�dstr	r	r
�
_copy_archive5s


 r'Fc
Cs�d}t|d�rt|d�rd}nt�|�}|��r4d}|rHt|||�dS|��sXtd��|d��}|rt|rttd��|s�|s�td��d}|r�|�d	�\}	}
}td
d�|	�	d�D��}td
d�|�	d�D��}
|
d	kr�|r�|
s�td|��t
j|	|d�}|dk�r|�d�}nt|d��s"t�|�}t
|d���}t||�|�rDtjntj}tj|d|d��b}xB|�d�D]4}|�|�}|dk�s�||��rh|�||����qhW|�r�|�d|�d��WdQRXWdQRX|�r�t|d��s�|�|��jtjB�dS)NFrrTzSource does not existz__main__.pyz8Cannot specify entry point if the source has __main__.pyzArchive has no entry point�:css|]}|��VqdS)N)�isidentifier)�.0�partr	r	r
�	<genexpr>{sz!create_archive.<locals>.<genexpr>�.css|]}|��VqdS)N)r))r*r+r	r	r
r,|szInvalid entry point: )�module�fnz.pyzrr�w)�compression�*zutf-8)�hasattr�pathlibZPath�is_filer'�existsr�	partition�all�split�
MAIN_TEMPLATE�formatZwith_suffixrr�zipfileZZIP_DEFLATEDZ
ZIP_STOREDZZipFileZrglobZrelative_torZas_posixZwritestrrr!r"r#r$)�source�targetr�main�filter�
compressedZsource_is_fileZhas_mainZmain_py�mod�sepr/Zmod_okZfn_ok�fdr1�zZchildZarcnamer	r	r
rLsT




&c	Cs:t|d��&}|�d�dkr,|�����t�SWdQRXdS)Nrrs#!)rrr�strip�decoder)rrr	r	r
r�scCs<ddl}|��}|jddddd�|jddddd�|jd	d
ddd�|jdd
ddd�|jddddd�|jddd�|�|�}|jr�tj�|j�s�t	d��t
|j�}td�|p�d��t
�d�tj�|j��r|jdk�stj�|j��rtj�|j|j��rt	d��|j�rt	d��t|j|j|j|j|jd�dS)Nrz--outputz-ozAThe name of the output archive. Required if SOURCE is an archive.)�default�helpz--pythonz-pzEThe name of the Python interpreter to use (default: no shebang line).z--mainz-mzLThe main function of the application (default: use an existing __main__.py).z
--compressz-c�
store_truezQCompress files with the deflate method. Files are stored uncompressed by default.)�actionrIz--infoFz)Display the interpreter from the archive.)rHrKrIr=z'Source directory (or existing archive).)rIz%Can only get info for an archive filezInterpreter: {}z<none>z-In-place editing of archives is not supportedz,Cannot change the main function when copying)rr?rA)�argparse�ArgumentParser�add_argument�
parse_args�infor
�path�isfiler=�
SystemExitr�printr;�sys�exit�outputr6�samefiler?r�python�compress)�argsrL�parserrr	r	r
r?�s<








r?�__main__)N)NNNNF)N)�
contextlibr
r4r r"rUr<�__all__r:�platform�
startswithr�getfilesystemencoding�
ValueErrorr�contextmanagerrrr'rrr?rr	r	r	r
�<module>s*
	

I
1

Zerion Mini Shell 1.0