a ˆåÏhZkã @s:dZddlZddlZddlmZddlmZddlmZddl m Z ddl m Z ddl mZdd lmZmZmZdd lmZdd l mZdd lmZdd lmZdZddddddœZddddddœddddddœeddddddœddddddœdœZe�r"dddd d!dœed"<ddd#d$d!dœed%<dZGd&d'„d'eƒZdS)(zFdistutils.command.install Implements the Distutils 'install' command.éN)Úlog)ÚCommand)ÚDEBUG)Úget_config_vars)ÚDistutilsPlatformError)Ú write_file)Ú convert_pathÚ subst_varsÚ change_root)Ú get_platform)ÚDistutilsOptionError)Ú USER_BASE)Ú USER_SITETz$base/Lib/site-packagesz$base/Include/$dist_namez $base/Scriptsz$base)ÚpurelibÚplatlibÚheadersÚscriptsÚdataz/$base/lib/python$py_version_short/site-packagesz;$platbase/$platlibdir/python$py_version_short/site-packagesz9$base/include/python$py_version_short$abiflags/$dist_namez $base/binz$base/lib/pythonz$base/$platlibdir/pythonz$base/include/python/$dist_namez$base/site-packagesz$base/include/$dist_name)Ú unix_prefixÚ unix_homeÚntÚpypyÚpypy_ntz $usersitez4$userbase/Python$py_version_nodot/Include/$dist_namez)$userbase/Python$py_version_nodot/Scriptsz $userbaseZnt_userz=$userbase/include/python$py_version_short$abiflags/$dist_namez $userbase/binÚ unix_userc@seZdZdZgd¢Zgd¢Zer>e dddef¡e d¡ddiZ d d „Z d d „Z d d„Z dd„Z dd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd „Zd!d"„Zd#d$„Zd%d&„Zd'd(„Zd)d*„Zd+d,„Zd-d.„Zd/d0„Zd1d2„Zd3efd4efd5efd6efd7d8d9„fgZdS):Úinstallz'install everything from build directory))zprefix=Nzinstallation prefix)z exec-prefix=Nz.(Unix only) prefix for platform-specific files)zhome=Nz+(Unix only) home directory to install under)z install-base=Nz;base installation directory (instead of --prefix or --home))zinstall-platbase=Nz\base installation directory for platform-specific files (instead of --exec-prefix or --home))zroot=Nz|j r\|  ¡|j rº|  ¡}|j r t|j ƒ}tt|ƒƒD]}|||d…||<q†| t|j |fd|j ¡ttjjtjƒ}ttjj|ƒ}tj tj |j¡¡}|j�r|j �r|j�s||v�rt d|j¡dS)zRuns the command.rIz"Can't install when cross-compilingNz'writing list of installed files to '%s'zƒmodules installed to '%s', which is not in Python's module search path (sys.path) -- you'll have to change the search path yourself)r5Z run_commandrTZget_command_objZ plat_namer6r rÚget_sub_commandsrŠÚcreate_path_filer9Ú get_outputsr)r‰ÚrangeÚexecuterÚmaprJr`rrrPÚnormcaser-r4rri)r;Z build_platÚcmd_nameÚoutputsZroot_lenZcounterZsys_pathr-r<r<r=Úrun2sD    ÿþÿÿþýz install.runcCsJtj |j|jd¡}|jr8| t||jgfd|¡n|  d|¡dS)zCreates the .pth fileú.pthz creating %szpath file '%s' not createdN) rJr`rar_rŠr4r”rrbrL)r;Úfilenamer<r<r=r‘^s ÿ þzinstall.create_path_filecCshg}| ¡D].}| |¡}| ¡D]}||vr"| |¡q"q |jrd|jrd| tj |j |jd¡¡|S)z.Assembles the outputs of all the sub-commands.rš) r�Úget_finalized_commandr’ÚappendrŠr4rJr`rar_)r;r˜r—Úcmdr›r<r<r=r’ls    ÿzinstall.get_outputscCs.g}| ¡D]}| |¡}| | ¡¡q |S)z*Returns the inputs of all the sub-commands)r�rœÚextendÚ get_inputs)r;Zinputsr—ržr<r<r=r }s   zinstall.get_inputscCs|j ¡p|j ¡S)zSReturns true if the current distribution has any Python modules to install.)rTZhas_pure_modulesZhas_ext_modulesr:r<r<r=Úhas_lib‰s ÿzinstall.has_libcCs |j ¡S)zLReturns true if the current distribution has any headers to install.)rTÚ has_headersr:r<r<r=r¢�szinstall.has_headerscCs |j ¡S)zMReturns true if the current distribution has any scripts to. install.)rTÚ has_scriptsr:r<r<r=r£”szinstall.has_scriptscCs |j ¡S)zJReturns true if the current distribution has any data to. install.)rTZhas_data_filesr:r<r<r=Úhas_data™szinstall.has_datar-r,r.r/Zinstall_egg_infocCsdS)NTr<r:r<r<r=Ú¤ózinstall.) Ú__name__Ú __module__Ú __qualname__Ú descriptionrjZboolean_optionsrXr�rrkr>rdrMrNrOrqr‚rYr[r]r^rcr\r™r‘r’r r¡r¢r£r¤Z sub_commandsr<r<r<r=rWsJ;ÿ N( " ,  ür)Ú__doc__rPrJZ distutilsrZdistutils.corerZdistutils.debugrZdistutils.sysconfigrZdistutils.errorsrZdistutils.file_utilrZdistutils.utilrr r r r Zsiter rrXZWINDOWS_SCHEMEryrzrr<r<r<r=Úsz          û ûûûûé!û ú