a
´io ã @ s¼ d dl Z d dlZd dlZd dlZd dlZd dlZd dlZg d¢ZdZej
d¡rVdZne ¡ ZG dd„ de
ƒZe jdd „ ƒZd
d„ Zddd
„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.9/zipapp.pyr ! s r c c sL t | ttjfƒrBt| |ƒ�}|V W d ƒ qH1 s60 Y 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ƒ�x}| d¡}|dkr*d}| ¡ t |dƒ�0}t||ƒ | |¡ t ||¡ W d ƒ n1 sj0 Y W d ƒ n1 sˆ0 Y |rºt|tƒrºt
|t |¡jtj
B ¡ dS )z8Copy an application archive, modifying the shebang line.Úrbé r ó ÚwbN)r ÚreadÚreadliner r ÚshutilÚcopyfileobjr
r r ÚchmodÚstatÚst_modeÚS_IEXEC)r Znew_archiver ÚsrcZfirst_2Údstr
r
r Ú
_copy_archive5 s
Hr+ 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�}|du �r| d¡}nt |dƒ�s"t |¡}t
|dƒ�¶}t||ƒ |�rDtjntj}tj|d|d��h}| d¡D ]4}| | ¡}|du �sˆ||ƒ�rf| || ¡ ¡ �qf|�r´| d| d¡¡ W d ƒ n1 �sÊ0 Y W d ƒ n1 �sê0 Y |�rt |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 Ú