U âQab‡ ã@sXddlmZddlmmZddlZddlZddlm Z m Z m Z Gdd„dejƒZdS)é)ÚlogN)Ú 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 úF/usr/lib/python3.8/site-packages/setuptools/command/install_scripts.pyr s z"install_scripts.initialize_optionsc Csöddlmm}| d¡|jjr2tj |¡ng|_ |j rBdS|  d¡}t |j t|j |jƒ|j|jƒ}|  d¡}t|ddƒ}|  d¡}t|ddƒ}|j}|rªd}|j}|tjkrº|g}| ¡}|j ¡ |¡} | ||  ¡¡D]} |j| ŽqâdS) 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_baserr Zegg_nameZ egg_versionÚgetattrZ 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 rs8   þ     zinstall_scripts.runÚtc Gs‚ddlm}m}t d||j¡tj |j|¡}|j   |¡|ƒ}|j s~t |ƒt |d|ƒ} |  |¡|  ¡||d|ƒdS)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 r3s  zinstall_scripts.write_scriptN)r)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrrr r r r r s#r) Z distutilsrZ!distutils.command.install_scriptsrrrrrZ pkg_resourcesrrrr r r r Ús