B
Mjo @ s d dl Z d dlZd dlZd dlZd dlZd dlZd dlZdddgZdZej
drXdZne ZG dd de
Ze jd d
Zdd Zdd
dZdddZdd ZdddZedkre dS ) NZipAppErrorcreate_archiveget_interpreterz8# -*- coding: utf-8 -*-
import {module}
{module}.{fn}()
winzutf-8c @ s e Zd ZdS )r N)__name__
__module____qualname__ r r +/opt/alt/python37/lib64/python3.7/zipapp.pyr ! s c c s8 t | ttjfr.t| |}|V W d Q R X n| V d S )N)
isinstancestrosPathLikeopen)archivemodefr r r
_maybe_open% s r c C s$ |r d| t d }| | dS )zWrite a shebang line.s #!
N)encodeshebang_encodingwrite)r interpreterZshebangr r r
_write_file_prefix. s r c
C s t | dZ}|d}|dkr*d}| t |d&}t|| || t|| W dQ R X W dQ R X |rt|trt
|t |jtj
B dS )z8Copy an application archive, modifying the shebang line.rb s #! wbN)r readreadliner r shutilZcopyfileobjr r r
chmodstatst_modeS_IEXEC)r Znew_archiver srcZfirst_2dstr r r
_copy_archive5 s
r'