î M“Reã@sbddlmZddlmZmZmZddlZddlm Z Gdd„deƒZdS)é)Úinstall_scripts)Ú DistributionÚ PathMetadataÚensure_directoryN)Úlogc@s=eZdZdZdd„Zdd„Zddd„Zd S) rz;Do normal script install, plus any egg_info wrapper scriptscCstj|ƒd|_dS)NF)Ú_install_scriptsÚinitialize_optionsÚno_ep)Úself©r ú=/tmp/pip-l4uy7dan-build/setuptools/command/install_scripts.pyr s z"install_scripts.initialize_optionsc Csddlm}ddlm}|jdƒ|jjrItj|ƒn g|_|j r_dS|j dƒ}t |j t |j |jƒ|j|jƒ}|j dƒ}t|d|ƒ}t|j dƒdd ƒ}x'||||ƒD]}|j|ŒqêWdS) Nr)Úget_script_args)Úsys_executableÚegg_infoÚ build_scriptsÚ executableÚ bdist_wininstZ _is_runningF)Úsetuptools.command.easy_installr rÚ run_commandÚ distributionÚscriptsrÚrunÚoutfilesr Úget_finalized_commandrZegg_baserrÚegg_nameZ egg_versionÚgetattrÚ write_script) r r rZei_cmdÚdistZbs_cmdrZ is_wininstÚargsr r r rs$    zinstall_scripts.runÚtc Gs²ddlm}m}tjd||jƒtjj|j|ƒ}|j j |ƒ|ƒ}|j s®t |ƒt |d|ƒ} | j|ƒ| jƒ||d|ƒndS)z1Write an executable file to the scripts directoryr)ÚchmodÚ current_umaskzInstalling %s script to %sÚwiÿN)rr r!rÚinfoÚ install_dirÚosÚpathÚjoinrÚappendÚdry_runrÚopenÚwriteÚclose) r Ú script_nameÚcontentsÚmodeZignoredr r!ÚtargetÚmaskÚfr r r r(s     zinstall_scripts.write_scriptN)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrrr r r r rs   r) Z!distutils.command.install_scriptsrrÚ pkg_resourcesrrrr%Ú distutilsrr r r r Ús