U
e5do ã @ s¾ d dl Z d dlZd dlZd dlZd dlZd dlZd dlZdddgZdZej
d¡rXdZne ¡ ZG dd„ de
ƒZe jd d
„ ƒZdd„ Zdd
d„Zddd„Zdd„ Zddd„Zedkrºeƒ dS )é NÚZipAppErrorÚcreate_archiveÚget_interpreterz8# -*- coding: utf-8 -*-
import {module}
{module}.{fn}()
Úwinúutf-8c @ s e Zd ZdS )r N)Ú__name__Ú
__module__Ú__qualname__© r
r
ú/usr/lib64/python3.8/zipapp.pyr ! s c c s8 t | ttjfƒ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 }| |¡ dS )zWrite a shebang line.ó #!ó
N)ÚencodeÚshebang_encodingÚwrite)r ÚinterpreterZshebangr
r
r Ú_write_file_prefix. s r c
C s– t | dƒ�Z}| d¡}|dkr*d}| ¡ t |dƒ�&}t||ƒ | |¡ t ||¡ W 5 Q R X W 5 Q R X |r’t|tƒr’t
|t |¡jtj
B ¡ dS )z8Copy an application archive, modifying the shebang line.Úrbé r ó ÚwbN)r ÚreadÚreadliner r ÚshutilZcopyfileobjr
r r ÚchmodÚstatÚst_modeÚS_IEXEC)r Znew_archiver ÚsrcZfirst_2Zdstr
r
r Ú
_copy_archive5 s
r) Fc
C sô d}t | dƒrt | dƒrd}nt | ¡} | ¡ r4d}|rHt| ||ƒ dS | ¡ sXtdƒ‚| d ¡ }|rt|rttdƒ‚|s„|s„td ƒ‚d}|rö| d
¡\} }
}tdd„ | d
¡D ƒƒ}tdd„ | d
¡D ƒƒ}
|
d
krÜ|rÜ|
sètd| ƒ‚t
j| |d�}|dk�r| d¡}nt |dƒ�s"t |¡}t
|dƒ�–}t||ƒ |�rDtjntj}tj|d|d��^}| d¡D ]4}| | ¡}|dk�sˆ||ƒ�rf| || ¡ ¡ �qf|�r´| d| d¡¡ W 5 Q R X W 5 Q R X |�rðt |dƒ�sð| | ¡ jtjB ¡ dS )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" TNzSource does not existz__main__.pyz8Cannot specify entry point if the source has __main__.pyzArchive has no entry pointú:c s s | ]}| ¡ V qd S r ©Úisidentifier©Ú.0Úpartr
r
r Ú