ôY‡ ã@ssddlmZddljjZddlZddlZddlm Z m Z m Z Gdd„dejƒZdS)é)ÚlogN)Ú DistributionÚ PathMetadataÚensure_directoryc@s=eZdZdZdd„Zdd„Zddd„Zd S) Úinstall_scriptsz;Do normal script install, plus any egg_info wrapper scriptscCstjj|ƒd|_dS)NF)ÚorigrÚinitialize_optionsÚno_ep)Úself©r úH/tmp/pip-build-3puug3g5/setuptools/setuptools/command/install_scripts.pyr sz"install_scripts.initialize_optionsc Cs`ddljj}|jdƒ|jjr>tjj|ƒn g|_ |j rTdS|j dƒ}t |j t|j |jƒ|j|jƒ}|j dƒ}t|ddƒ}|j dƒ}t|ddƒ}|j}|rðd}|j}|tjkr|g}|jƒ}|jjƒj|ƒ} x-|j|| jƒƒD]} |j| ŒqEWdS) NrÚegg_infoÚ build_scriptsÚ executableÚ bdist_wininstZ _is_runningFz python.exe)Úsetuptools.command.easy_installÚcommandÚ easy_installÚ run_commandÚ distributionÚscriptsrrÚrunÚoutfilesr Úget_finalized_commandrZegg_baserr Úegg_nameZ egg_versionÚgetattrZ ScriptWriterZWindowsScriptWriterÚsysrÚbestZcommand_spec_classÚ from_paramZget_argsZ as_headerÚ write_script) r ÚeiZei_cmdÚdistZbs_cmdZ exec_paramZbw_cmdZ is_wininstÚwriterÚcmdÚargsr r r rs2        zinstall_scripts.runÚtc Gs¯ddlm}m}tjd||jƒtjj|j|ƒ}|j j |ƒ|ƒ}|j s«t |ƒt |d|ƒ} | j|ƒ| jƒ||d|ƒdS)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 r3s     zinstall_scripts.write_scriptN)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrrr r r r r s   #r) Ú distutilsrZ!distutils.command.install_scriptsrrrr+rÚ pkg_resourcesrrrr r r r Ús