_d7 hddlmZddlmcmZddlZddlZddlm Z GddejZy))logN)ensure_directoryc*eZdZdZdZdZdZddZy)install_scriptsz;Do normal script install, plus any egg_info wrapper scriptscPtjj|d|_y)NF)origrinitialize_optionsno_epselfs D/usr/lib/python3/dist-packages/setuptools/command/install_scripts.pyr z"install_scripts.initialize_options s //5 c|jd|jjr tjj |ng|_|jry|jy)Negg_info) run_command distributionscriptsr rrunoutfilesr _install_ep_scriptsr s rrzinstall_scripts.runsP $    $ $  $ $T *DM ::    "rc$ddlm}m}ddlm}|j d}||j ||j |j|j|j}|j d}t|dd}|j}|tjk(r|g}|j}|jjj!|} |j#|| j%D]} |j&| y)Nr) Distribution PathMetadata) easy_installr build_scripts executable) pkg_resourcesrrrget_finalized_commandegg_baseregg_name egg_versiongetattr ScriptWritersysrbestcommand_spec_class from_paramget_args as_header write_script) r rreiei_cmddistbs_cmd exec_paramwritercmdargss rrz#install_scripts._install_ep_scriptss<(++J7 OO &// : OO      ++O<V\48   '%J'',,.99*EOOD#--/: %D D  t $ %rcddlm}m}tjd||j t jj|j |}|jj||}|jsHt|t|d|z} | j|| j||d|z yy)z1Write an executable file to the scripts directoryr)chmod current_umaskzInstalling %s script to %swiN)setuptools.command.easy_installr7r8rinfo install_dirospathjoinrappenddry_runropenwriteclose) r script_namecontentsmodeignoredr7r8targetmaskfs rr-zinstall_scripts.write_script4sH -{DrVs)00 $9(d**9(r