
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
U
    ¡ê,ao  ã                   @   s¾   d dl Z d dlZd dlZd dlZd dlZd dlZd dlZdddgZdZej	 
d¡rXdZne ¡ ZG dd„ deƒZe jd	d
„ ƒZdd„ Zddd„Zddd„Zdd„ Zddd„Zedkrºeƒ  dS )é    NÚZipAppErrorÚcreate_archiveÚget_interpreterz8# -*- coding: utf-8 -*-
import {module}
{module}.{fn}()
Úwinúutf-8c                   @   s   e Zd ZdS )r   N)Ú__name__Ú
__module__Ú__qualname__© r
   r
   ú+/opt/alt/python38/lib64/python3.8/zipapp.pyr   !   s   c              	   c   s8   t | ttjfƒr.t| |ƒ�}|V  W 5 Q R X n| V  d S ©N)Ú
isinstanceÚstrÚosÚPathLikeÚopen)ÚarchiveÚmodeÚfr
   r
   r   Ú_maybe_open%   s    r   c                 C   s$   |r d|  t¡ d }|  |¡ d S )Nó   #!ó   
)ÚencodeÚshebang_encodingÚwrite)r   ÚinterpreterZshebangr
   r
   r   Ú_write_file_prefix.   s    r   c              
   C   s–   t | dƒ�Z}| d¡}|dkr*d}| ¡  t |dƒ�&}t||ƒ | |¡ t ||¡ W 5 Q R X W 5 Q R X |r’t|tƒr’t	 
|t	 |¡jtjB ¡ d S )NÚrbé   r   ó    Úwb)r   ÚreadÚreadliner   r   ÚshutilZcopyfileobjr   r   r   ÚchmodÚstatÚst_modeÚS_IEXEC)r   Znew_archiver   ÚsrcZfirst_2Zdstr
   r
   r   Ú_copy_archive5   s    


 r)   Fc              
   C   sô  d}t | dƒrt | dƒrd}nt | ¡} |  ¡ r4d}|rHt| ||ƒ d S |  ¡ sXtdƒ‚| d  ¡ }|rt|rttdƒ‚|s„|s„tdƒ‚d }|rö| d	¡\}	}
}td
d„ |	 	d¡D ƒƒ}tdd„ | 	d¡D ƒƒ}|
d	krÜ|rÜ|sètd| ƒ‚t
j|	|d�}|d k�r|  d¡}nt |dƒ�s"t |¡}t|dƒ�–}t||ƒ |�rDtjntj}tj|d|d��^}|  d¡D ]4}| | ¡}|d k�sˆ||ƒ�rf| || ¡ ¡ �qf|�r´| d| d¡¡ W 5 Q R X W 5 Q R X |�rðt |dƒ�sð| | ¡ jtjB ¡ d S )NFr!   r"   TzSource does not existz__main__.pyz8Cannot specify entry point if the source has __main__.pyzArchive has no entry pointú:c                 s   s   | ]}|  ¡ V  qd S r   ©Úisidentifier©Ú.0Úpartr
   r
   r   Ú	<genexpr>{   s     z!create_archive.<locals>.<genexpr>Ú.c                 s   s   | ]}|  ¡ V  qd S r   r+   r-   r
   r
   r   r0   |   s     zInvalid entry point: )ÚmoduleÚfnz.pyzr   r    Úw)ÚcompressionÚ*r   )ÚhasattrÚpathlibÚPathÚis_filer)   Úexistsr   Ú	partitionÚallÚsplitÚMAIN_TEMPLATEÚformatZwith_suffixr   r   ÚzipfileZZIP_DEFLATEDZ
ZIP_STOREDZZipFileZrglobÚrelative_tor   Zas_posixZwritestrr   r$   r%   r&   r'   )ÚsourceÚtargetr   ÚmainÚfilterÚ
compressedZsource_is_fileZhas_mainZmain_pyÚmodÚsepr3   Zmod_okZfn_okÚfdr5   ÚzZchildZarcnamer
   r
   r   r   L   sX    
ÿ


ÿ
&c              
   C   sF   t | dƒ�2}| d¡dkr8| ¡  ¡  t¡W  5 Q R £ S W 5 Q R X d S )Nr   r   r   )r   r!   r"   ÚstripÚdecoder   )r   r   r
   r
   r   r   –   s    c                 C   s<  dd l }| ¡ }|jddd dd� |jddd dd� |jd	d
d dd� |jddddd� |jddddd� |jddd� | | ¡} | jrÄtj | j¡sžt	dƒ‚t
| jƒ}td |p´d¡ƒ t d¡ tj | j¡�r| jd k�stj | j¡�rtj | j| j¡�rt	dƒ‚| j�rt	dƒ‚t| j| j| j| j| jd� d S )Nr   z--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.)ÚactionrO   z--infoFz)Display the interpreter from the archive.)rN   rQ   rO   rC   z'Source directory (or existing archive).)rO   z%Can only get info for an archive filezInterpreter: {}z<none>z-In-place editing of archives is not supportedz,Cannot change the main function when copying)r   rE   rG   )ÚargparseÚArgumentParserÚadd_argumentÚ
parse_argsÚinfor   ÚpathÚisfilerC   Ú
SystemExitr   Úprintr@   ÚsysÚexitÚoutputr;   ÚsamefilerE   r   ÚpythonÚcompress)ÚargsrR   Úparserr   r
   r
   r   rE   œ   sN    
ÿ
ÿ
ÿ
ÿ
ÿÿ


ÿ
 þrE   Ú__main__)N)NNNNF)N)Ú
contextlibr   r8   r#   r%   r[   rA   Ú__all__r?   ÚplatformÚ
startswithr   ÚgetfilesystemencodingÚ
ValueErrorr   Úcontextmanagerr   r   r)   r   r   rE   r   r
   r
   r
   r   Ú<module>   s0   



    ÿ
J
1