3
Pfx; @ s d dl mZ d dlZd dlZd dlZd dlZd dlZddlmZm Z m
Z
ddlmZ ddl
mZmZmZmZmZ ejeZdj ZejdZd Zd
d ZG dd
d
eZdS ) )BytesION ) sysconfigdetect_encodingZipFile)finder)FileOperatorget_export_entryconvert_pathget_executablein_venva
s ^#!.*pythonw?[0-9.]*([ ].*)?$a| # -*- coding: utf-8 -*-
if __name__ == '__main__':
import sys, re
def _resolve(module, func):
__import__(module)
mod = sys.modules[module]
parts = func.split('.')
result = getattr(mod, parts.pop(0))
for p in parts:
result = getattr(result, p)
return result
try:
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
func = _resolve('%(module)s', '%(func)s')
rc = func() # None interpreted as 0
except Exception as e: # only supporting Python >= 2.6
sys.stderr.write('%%s\n' %% e)
rc = 1
sys.exit(rc)
c C sZ d| krV| j drD| jdd\}}d|krV|j d rVd||f } n| j dsVd| } | S )N z
/usr/bin/env r "z%s "%s"z"%s")
startswithsplit)
executableenvZ_executable r /usr/lib/python3.6/scripts.py_enquote_executableB s
r c @ s e Zd ZdZeZdZd%ddZdd Ze j
jd rBd
d Zdd
Z
d&ddZdd ZeZdd Zdd Zd'ddZdd Zedd Zejdd Zejdksejd krejdkrdd Zd(d!d"Zd)d#d$ZdS )*ScriptMakerz_
A class to copy or create scripts from source scripts or callable
specifications.
NTFc C sz || _ || _|| _d| _d| _tjdkp:tjdko:tjdk| _t d| _
|pRt|| _tjdkprtjdkortjdk| _
d S )NFposixjava X.Ynt)r r )
source_dir
target_dir
add_launchersforceclobberosname_nameset_modesetvariantsr _fileop_is_nt)selfr r r dry_runZfileopr r r __init__[ s
zScriptMaker.__init__c C s@ |j ddr<| jr