a
ˆåÏh× ã @ sX d dl mZ d dlm mZ d dlZd dlZd dlm Z m
Z
mZ G dd„ dejƒZdS )é )ÚlogN)ÚDistributionÚPathMetadataÚensure_directoryc @ s* e Zd ZdZdd„ Zdd„ Zd
dd„Zd S )Úinstall_scriptsz;Do normal script install, plus any egg_info wrapper scriptsc C s t j | ¡ d| _d S )NF)Úorigr Úinitialize_optionsÚno_ep)Úself© r úF/usr/lib/python3.9/site-packages/setuptools/command/install_scripts.pyr s z"install_scripts.initialize_optionsc C s dd l m m} | d¡ | jjr2tj | ¡ ng | _ | j
rBd S | d¡}t|j
t|j
|jƒ|j|jƒ}| d¡}t|dd ƒ}z| d¡}t|ddƒ}W n ty° d}Y n0 |j}|rÆd}|j}|tjkrÖ|g}| ¡ }|j ¡ |¡} | || ¡ ¡D ]}
| j|
Ž qþd S ) Nr Úegg_infoZ
build_scriptsÚ
executableZ
bdist_wininstZ_is_runningFz
python.exe)Úsetuptools.command.easy_installÚcommandZeasy_installZrun_commandZdistributionZscriptsr r ÚrunÚoutfilesr Zget_finalized_commandr Zegg_baser r
Zegg_nameZegg_versionÚgetattrÚImportErrorZScriptWriterZWindowsScriptWriterÚsysr ZbestZcommand_spec_classZ
from_paramÚget_argsZ as_headerÚwrite_script)r
ZeiZei_cmdZdistZbs_cmdZ
exec_paramZbw_cmdZ
is_wininstÚwriterÚcmdÚargsr r r r s:
þ
zinstall_scripts.runÚtc
G s‚ ddl m}m} t d|| j¡ tj | j|¡}| j
|¡ |ƒ }| js~t|ƒ t
|d| ƒ} | |¡ | ¡ ||d| ƒ dS )z1Write an executable file to the scripts directoryr )ÚchmodÚ
current_umaskzInstalling %s script to %sÚwiÿ N)r r r r ÚinfoZinstall_dirÚosÚpathÚjoinr ÚappendÚdry_runr ÚopenÚwriteÚclose)
r
Úscript_nameÚcontentsÚmodeZignoredr r ÚtargetÚmaskÚfr r r r 6 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 Ú