o ¯)»a! ã@sdddlmZddlmmZddlmZddlZddl Z ddl m Z m Z m Z Gdd„dejƒZdS)é)ÚlogN)ÚDistutilsModuleError)Ú DistributionÚ PathMetadataÚensure_directoryc@s*eZdZdZdd„Zdd„Zd dd„Zd S) Úinstall_scriptsz;Do normal script install, plus any egg_info wrapper scriptscCstj |¡d|_dS)NF)ÚorigrÚinitialize_optionsÚno_ep)Úself©r úU/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/install_scripts.pyr s  z"install_scripts.initialize_optionsc Csddlmm}| d¡|jjrtj |¡ng|_ |j r!dS|  d¡}t |j t|j |jƒ|j|jƒ}|  d¡}t|ddƒ}z |  d¡}t|ddƒ}Wn ttfyZd}Ynw|j}|red}|j}|tjkrm|g}| ¡}|j ¡ |¡} | ||  ¡¡D]} |j| ŽqdS) NrÚegg_infoZ build_scriptsÚ executableZ bdist_wininstZ _is_runningFz python.exe)Úsetuptools.command.easy_installÚcommandZ easy_installZ run_commandZ distributionZscriptsrrÚrunÚoutfilesr Zget_finalized_commandrZegg_baserrZegg_nameZ egg_versionÚgetattrÚ ImportErrorrZ ScriptWriterZWindowsScriptWriterÚsysrZbestZcommand_spec_classZ from_paramZget_argsZ as_headerÚ write_script) r ZeiZei_cmdZdistZbs_cmdZ exec_paramZbw_cmdZ is_wininstÚwriterÚcmdÚargsr r r rs>  þ   ÿ  ÿzinstall_scripts.runÚtc Gs†ddlm}m}t d||j¡tj |j|¡}|j   |¡|ƒ}|j sAt |ƒt |d|ƒ} |  |¡|  ¡||d|ƒdSdS)z1Write an executable file to the scripts directoryr)ÚchmodÚ current_umaskzInstalling %s script to %sÚwiÿN)rrrrÚinfoZ install_dirÚosÚpathÚjoinrÚappendZdry_runrÚopenÚwriteÚclose) r Z script_nameÚcontentsÚmodeZignoredrrÚtargetÚmaskÚfr r r r7s  ûzinstall_scripts.write_scriptN)r)Ú__name__Ú __module__Ú __qualname__Ú__doc__r rrr r r r r s &r)Z distutilsrZ!distutils.command.install_scriptsrrrZdistutils.errorsrr rZ pkg_resourcesrrrr r r r Ús