3
l]j @ sR d dl mZ d dljjZd dlZd dlZd dlm Z m
Z
mZ G dd dejZdS ) )logN)DistributionPathMetadataensure_directoryc @ s* e Zd ZdZdd Zdd Zd
ddZd S )install_scriptsz;Do normal script install, plus any egg_info wrapper scriptsc C s t jj| d| _d S )NF)origr initialize_optionsno_ep)self r %/usr/lib/python3.6/install_scripts.pyr s z"install_scripts.initialize_optionsc C s dd l jj}| jd | jjr,tjj| ng | _ | j
r<d S | jd}t|j
t|j
|j|j|j}| jd}t|dd }| jd}t|dd}|j}|rd}|j}|tjkr|g}|j }|jj j|} x"|j|| j D ]}
| j|
qW d S ) Nr egg_infoZ
build_scripts
executableZ
bdist_wininstZ_is_runningFz
python.exe)setuptools.command.easy_installcommandZeasy_installZrun_commandZdistributionscriptsr r runoutfilesr Zget_finalized_commandr Zegg_baser r
Zegg_nameZegg_versiongetattrZScriptWriterZWindowsScriptWritersysr ZbestZcommand_spec_classZ
from_paramZget_argsZ as_headerwrite_script)r
ZeiZei_cmdZdistZbs_cmdZ
exec_paramZbw_cmdZ
is_wininstwritercmdargsr r r r s2
zinstall_scripts.runtc
G s ddl m}m} tjd|| j tjj| j|}| j j
| | }| js~t| t
|d| } | j| | j ||d| dS )z1Write an executable file to the scripts directoryr )chmod
current_umaskzInstalling %s script to %swi N)r r r r infoZinstall_dirospathjoinr appendZdry_runr openwriteclose)
r
Zscript_namecontentsmodeZignoredr r targetmaskfr r r r 3 s
zinstall_scripts.write_scriptN)r )__name__
__module____qualname____doc__r r r r r r r r s #r )Z distutilsr Z!distutils.command.install_scriptsr r r r r Z
pkg_resourcesr r r r r r r <module> s