
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!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 )zWrite a shebang line.ó   #!ó   
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 )z8Copy an application archive, modifying the shebang line.Úrbé   r   ó    ÚwbN)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 )ab  Create an application archive from SOURCE.

    The SOURCE can be the name of a directory, or a filename or a file-like
    object referring to an existing archive.

    The content of SOURCE is packed into an application archive in TARGET,
    which can be a filename or a file-like object.  If SOURCE is a directory,
    TARGET can be omitted and will default to the name of SOURCE with .pyz
    appended.

    The created application archive will have a shebang line specifying
    that it should run with INTERPRETER (there will be no shebang line if
    INTERPRETER is None), and a __main__.py which runs MAIN (if MAIN is
    not specified, an existing __main__.py will be used).  It is an error
    to specify MAIN for anything other than a directory source with no
    __main__.py, and it is an error to omit MAIN if the directory has no
    __main__.py.
    Fr!   r"   TNz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 )zÞRun the zipapp command line interface.

    The ARGS parameter lets you specify the argument list directly.
    Omitting ARGS (or setting it to None) works as for argparse, using
    sys.argv[1:] as the argument list.
    r   Nz--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