�
!A?ho � �* � d dl Z d dlZd dlZd dlZd dlZd dlZd dlZg d�ZdZej �
d� � rdZn ej � � Z G d� de
� � Ze j d� � � Zd � Zdd
�Z dd�Zd
� Zdd�Zedk r e� � dS dS )� N)�ZipAppError�create_archive�get_interpreterz8# -*- coding: utf-8 -*-
import {module}
{module}.{fn}()
�win�utf-8c � � e Zd ZdS )r N)�__name__�
__module__�__qualname__� � �3/opt/alt/python-internal/lib64/python3.11/zipapp.pyr r ! s � � � � � ��Dr
r c # � K � t | t t j f� � r/t | |� � 5 }|V � d d d � � d S # 1 swxY w Y d S | V � d S �N)�
isinstance�str�os�PathLike�open)�archive�mode�fs r �_maybe_openr % s� � � � ��'�C���-�.�.� �
�'�4�
�
� �A��G�G�G� � � � � � � � � � � � ���� � � � � � � �
�
�
�
�
s �A�A
�
A
c �x � |r7d|� t � � z dz }| � |� � dS dS )zWrite a shebang line.� #!�
N)�encode�shebang_encoding�write)r �interpreter�shebangs r �_write_file_prefixr" . sJ � �� ��+�,�,�-=�>�>�>��F�� ���������� r
c �$ � t | d� � 5 }|� d� � }|dk rd}|� � � t |d� � 5 }t ||� � |� |� � t j ||� � ddd� � n# 1 swxY w Y ddd� � n# 1 swxY w Y |rPt |t � � r=t j
|t j |� � j t j
z � � dS dS dS )z8Copy an application archive, modifying the shebang line.�rb� r r
�wbN)r �read�readliner" r �shutil�copyfileobjr r r �chmod�stat�st_mode�S_IEXEC)r �new_archiver �src�first_2�dsts r �
_copy_archiver3 5 s� � � �W�d� #� #� )�s� �(�(�1�+�+���e����G��L�L�N�N�N�
��d�
+�
+� )�s��s�K�0�0�0�
�I�I�g������s�C�(�(�(�
)� )� )� )� )� )� )� )� )� )� )���� )� )� )� )�)� )� )� )� )� )� )� )� )� )� )���� )� )� )� )�" � K�z�+�s�3�3� K�
���b�g�k�2�2�:�T�\�I�J�J�J�J�J�K� K� K� Ks6 �AB1�;B�B1�B �B1�!B �"B1�1B5�8B5Fc � � d}t | d� � rt | d� � rd}n*t j | � � } | � � � rd}|rt | ||� � dS | � � � st
d� � �| dz � � � }|r|rt
d� � �|s|st
d � � �d}|r�|� d
� � \ } }
}t d� | � d� � D � � � � }t d
� |� d� � D � � � � }
|
d
k r|r|
st
d|z � � �t � | |�� � }|�| � d� � }n$t |d� � st j |� � }t |d� � 5 }t ||� � |rt j nt j }t j |d|�� � 5 }| � d� � D ]L}|� | � � }|� ||� � r(|� ||� � � � � �M|r)|� d|� d� � � � ddd� � n# 1 swxY w Y ddd� � n# 1 swxY w Y |rKt |d� � s=|� |� � � j t4 j z � � dS dS 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 3 �> K � | ]}|� � � V � �d S r ��isidentifier��.0�parts r �