Your IP : 52.14.7.53


Current Path : /opt/alt/python34/lib64/python3.4/distutils/command/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib64/python3.4/distutils/command/__pycache__/install.cpython-34.pyc

�
h f�g�@s�dZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZdd	lmZmZmZdd
lmZddlmZddlmZdd
lmZdZidd6dd6dd6dd6dd6Ziidd6dd6dd6dd6dd6d6idd6dd6dd6dd6dd6d 6ed!6Zer�id"d6d"d6d#d6d$d6d%d6ed&<id"d6d"d6d'd6d(d6d%d6ed)<nd,ZGd*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-packages�purelib�platlibz$base/Include/$dist_name�headersz
$base/Scripts�scriptsz$base�dataz/$base/lib/python$py_version_short/site-packagesz5$platbase/lib64/python$py_version_short/site-packagesz9$base/include/python$py_version_short$abiflags/$dist_namez	$base/bin�unix_prefixz$base/lib/pythonz$base/lib64/pythonz$base/include/python/$dist_name�	unix_home�ntz	$usersitez4$userbase/Python$py_version_nodot/Include/$dist_namez$userbase/Scriptsz	$userbase�nt_userz=$userbase/include/python$py_version_short$abiflags/$dist_namez
$userbase/bin�	unix_userc@s�eZdZdZd_d`dadbdddd
fdcdddeddddfdfdgdhdidjdkdldmdngZdd%d(gZer�ejd,dd-ef�ejd,�nidd 6Z	d.d/�Z
d0d1�Zd2d3�Zd4d5�Z
d6d7�Zd8d9�Zd:d;�Zd<d=�Zd>d?�Zd@dA�ZdBdC�ZdDdE�ZdFdG�ZdHdI�ZdJdK�ZdLdM�ZdNdO�ZdPdQ�ZdRdS�ZdTdU�ZdVdW�ZdXefdYefdZefd[efd\d]d^�fgZdS)o�installz'install everything from build directory�prefix=N�installation prefix�exec-prefix=�.(Unix only) prefix for platform-specific files�home=�+(Unix only) home directory to install under�
install-base=�;base installation directory (instead of --prefix or --home)zinstall-platbase=z8base installation directory for platform-specific files z$(instead of --exec-prefix or --home)�root=�<install everything relative to this alternate root directory�install-purelib=�;installation directory for pure Python module distributions�install-platlib=�8installation directory for non-pure module distributionszinstall-lib=z4installation directory for all module distributions z3(overrides --install-purelib and --install-platlib)�install-headers=�(installation directory for C/C++ headers�install-scripts=�)installation directory for Python scripts�
install-data=�%installation directory for data files�compile�c�compile .py to .pyc [default]�
no-compile�don't compile .py files�	optimize=�O�lalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0]�force�f�1force installation (overwrite any existing files)�
skip-build�2skip rebuilding everything (for testing/debugging)�record=�3filename in which to record list of installed files�userz!install in user site-package '%s'cCs�d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_t
|_t|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)zInitializes options.Nr�)�prefix�exec_prefix�homer=�install_base�install_platbase�root�install_purelib�install_platlib�install_headers�install_lib�install_scripts�install_datar
�install_userbaser�install_usersiter.�optimize�
extra_path�install_path_filer6�
skip_build�warn_dir�
build_base�	build_lib�record)�self�rV�>/opt/alt/python34/lib64/python3.4/distutils/command/install.py�initialize_options�s2																	
							zinstall.initialize_optionscCs�|js|js|jr@|js-|jr@tdd��n|jrj|js[|jrjtd��n|jr�|js�|js�|js�|js�|jr�td��ntjdkr�|jr�|j	d�d|_q�n|j
d�tjdkr|j�n
|j�|j
d	�t
jj�d
}tdd�\}}y
t
j}Wntk
rrd
}YnXi|jj�d6|jj�d6|jj�d6|d6|d
d�d6|d
|dd6|d6|d6|d6|d6|d6|_tr#|j|jd<|j|jd<n|j�|j
d�|j|jd<|j|jd<tr�d
dlm}td�||j�n|j�|j
d �|jr�|j �n|j!dkr�|jj"r�|j#|_!q�|j$|_!n|j%d!d"d#d$d%d&dd�|j&�|j!|_'tj(j)|j!|j*�|_!|j+dk	rw|j,d'd!d"d#d$d%d&�n|j
d(�|j-d)d,d-�dS).zFinalizes options.z.must supply either prefix/exec-prefix/home or z)install-base/install-platbase -- not bothz9must supply either home or prefix/exec-prefix -- not bothzGcan't combine user with prefix, exec_prefix/home, or install_(plat)base�posixz+exec-prefix option ignored on this platformNzpre-finalize_{unix,other}zpost-finalize_{unix,other}()rr?r@�Z	dist_nameZdist_versionZ
dist_fullname�
py_version��py_version_short��py_version_nodotZ
sys_prefixZsys_exec_prefix�abiflags�userbaseZusersitezpost-expand_basedirs()�base�platbase)�pprintzconfig vars:zpost-expand_dirs()�librrrrrZlibbasezafter prepending root�buildrRrS)�
build_baserg)�	build_librh).r?r@rArBrCrr=�os�name�warn�	dump_dirs�
finalize_unix�finalize_other�sys�version�splitrr`�AttributeError�distributionZget_nameZget_versionZget_fullname�config_vars�
HAS_USER_SITErKrL�expand_basedirsrrd�print�expand_dirs�create_home_pathrHZext_modulesrFrE�
convert_paths�handle_extra_path�install_libbase�path�join�
extra_dirsrD�change_rootsZset_undefined_options)rUr[r?r@r`rdrVrVrW�finalize_options�s�
$	













	
	


	zinstall.finalize_optionscCs�ts
dSddlm}tj|d�x�|jD]�}|d}|ddkrh|dd	�}n||jkr�|j|}|j|�}t||�}n|j|�}t||�}tjd||f�q5WdS)
zDumps the list of user options.Nr)�
longopt_xlate�:r>�=z  %s: %s���r�)	rZdistutils.fancy_getoptr�r�debug�user_options�negative_opt�	translate�getattr)rU�msgr�ZoptZopt_name�valrVrVrWrlss

zinstall.dump_dirscCs�|jdk	s|jdk	r�|jdkrK|jdkrK|jdksx|jdksx|jdksx|jdkr�td��ndS|j	r�|j
dkr�td��n|j
|_|_|jd�n�|j
dk	r|j
|_|_|jd�n�|jdkrg|jdk	r4td��ntjjtj�|_tjjtj�|_n|jdkr�|j|_n|j|_|j|_|jd�dS)z&Finalizes options for posix platforms.NzPinstall-base or install-platbase supplied, but installation scheme is incompletez$User base directory is not specifiedrrz*must not supply exec-prefix without prefixr)rBrCrHrErFrGrIrJrr=rKr�
select_schemerAr?r@rir}�normpathro)rUrVrVrWrm�s<	zinstall.finalize_unixcCs|jrQ|jdkr'td��n|j|_|_|jtjd�n�|jdk	r�|j|_|_|jd�ny|j	dkr�tj
jtj	�|_	n|j	|_|_y|jtj�Wn%t
k
r�tdtj��YnXdS)z)Finalizes options for non-posix platformsNz$User base directory is not specifiedZ_userrz)I don't know how to install stuff on '%s')r=rKrrBrCr�rirjrAr?r}r�ro�KeyError)rUrVrVrWrn�s"	
zinstall.finalize_othercCsUt|}xDtD]<}d|}t||�dkrt||||�qqWdS)z=Sets the install directories by applying the install schemes.�install_N)�INSTALL_SCHEMES�SCHEME_KEYSr��setattr)rUrj�scheme�keyZattrnamerVrVrWr��s



zinstall.select_schemecCs�x�|D]y}t||�}|dk	rtjdksFtjdkr[tjj|�}nt||j�}t|||�qqWdS)NrYr)r�rirjr}�
expanduserr	rtr�)rU�attrs�attrr�rVrVrW�
_expand_attrs�s
zinstall._expand_attrscCs|jdddg�dS)zNCalls `os.path.expanduser` on install_base, install_platbase and
        root.rBrCrDN)r�)rUrVrVrWrv�szinstall.expand_basedirscCs#|jddddddg�dS)z+Calls `os.path.expanduser` on install dirs.rErFrHrGrIrJN)r�)rUrVrVrWrx�szinstall.expand_dirscGs>x7|D]/}d|}t||tt||���qWdS)z!Call `convert_path` over `names`.r�N)r�rr�)rU�namesrjr�rVrVrWrz�s

zinstall.convert_pathscCs�|jdkr!|jj|_n|jdk	r�t|jt�rZ|jjd�|_nt|j�dkr�|jd}}n3t|j�dkr�|j\}}ntd��t|�}nd}d}||_||_	dS)z4Set `path_file` and `extra_dirs` using `extra_path`.N�,r>rr^zY'extra_path' option must be a list, tuple, or comma-separated string with 1 or 2 elementsrZ)
rNrs�
isinstance�strrq�lenrr�	path_filer)rUr�rrVrVrWr{�s 		zinstall.handle_extra_pathc	GsDx=|D]5}d|}t||t|jt||���qWdS)z:Change the install directories pointed by name using root.r�N)r�r
rDr�)rUr�rjr�rVrVrWr�s

zinstall.change_rootscCs�|js
dSttjjd��}xc|jj�D]R\}}|j|�r5tjj|�r5|j	d|�tj
|d�q5q5WdS)zCreate directories under ~.N�~zos.makedirs('%s', 0o700)i�)r=rrir}r�rt�items�
startswith�isdirZdebug_print�makedirs)rUrArjr}rVrVrWrys	"zinstall.create_home_pathcCs�|jsU|jd�|jjd�j}|jrU|t�krUtd��qUnx!|j�D]}|j|�qbW|j	r�|j
�n|jr|j�}|j
r�t|j
�}x5tt|��D]}|||d�||<q�Wn|jt|j|fd|j�nttjjtj�}ttjj|�}tjjtjj|j��}|jr�|j	o�|jr�||kr�tjd|j�ndS)zRuns the command.rfz"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)rPZrun_commandrsZget_command_objZ	plat_namerQrr�get_sub_commandsr��create_path_filerT�get_outputsrDr��range�executer�maprir}r�ro�normcaserHrOrr�)rUZ
build_plat�cmd_name�outputsZroot_lenZcounterZsys_pathrHrVrVrW�runs6	
	
			!		zinstall.runcCsctjj|j|jd�}|jrN|jt||jgfd|�n|j	d|�dS)zCreates the .pth filez.pthzcreating %szpath file '%s' not createdN)
rir}r~r|r�rOr�rrrk)rU�filenamerVrVrWr�Cs		zinstall.create_path_filecCs�g}xV|j�D]H}|j|�}x0|j�D]"}||kr5|j|�q5q5WqW|jr�|jr�|jtjj|j	|jd��n|S)z.Assembles the outputs of all the sub-commands.z.pth)
r��get_finalized_commandr��appendr�rOrir}r~r|)rUr�r��cmdr�rVrVrWr�Qszinstall.get_outputscCsCg}x6|j�D](}|j|�}|j|j��qW|S)z*Returns the inputs of all the sub-commands)r�r��extend�
get_inputs)rUZinputsr�r�rVrVrWr�bs
zinstall.get_inputscCs|jj�p|jj�S)zSReturns true if the current distribution has any Python
        modules to install.)rsZhas_pure_modulesZhas_ext_modules)rUrVrVrW�has_libnszinstall.has_libcCs
|jj�S)zLReturns true if the current distribution has any headers to
        install.)rs�has_headers)rUrVrVrWr�tszinstall.has_headerscCs
|jj�S)zMReturns true if the current distribution has any scripts to.
        install.)rs�has_scripts)rUrVrVrWr�yszinstall.has_scriptscCs
|jj�S)zJReturns true if the current distribution has any data to.
        install.)rsZhas_data_files)rUrVrVrW�has_data~szinstall.has_datarHrGrIrJZinstall_egg_infocCsdS)NTrV)rUrVrVrW�<lambda>�szinstall.<lambda>)rNr)rNr)rNr)r Nr!)r"Nr#)r$Nr%)r&Nr')r(Nr))r*Nr+)r,Nr-)zcompiler/r0)r1Nr2)r3r4r5)zforcer7r8)r9Nr:)r;Nr<) �__name__�
__module__�__qualname__Zdescriptionr�Zboolean_optionsrur�rr�rXr�rlrmrnr�r�rvrxrzr{r�ryr�r�r�r�r�r�r�r�Zsub_commandsrVrVrVrWrIs�	
M�(		,				r)zpurelibzplatlibzheaderszscriptszdata)�__doc__roriZ	distutilsrZdistutils.corerZdistutils.debugrZdistutils.sysconfigrZdistutils.errorsrZdistutils.file_utilrZdistutils.utilrr	r
rrZsiter
rruZWINDOWS_SCHEMEr�r�rrVrVrVrW�<module>sb



?>