%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /snap/core18/current/usr/lib/python3.6/distutils/command/__pycache__/
Upload File :
Create Path :
Current File : //snap/core18/current/usr/lib/python3.6/distutils/command/__pycache__/install.cpython-36.pyc

3

��]Mp�	@s:dZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZdd	lmZmZmZdd
lmZddlmZddlmZdd
lmZdZdddddd�Zdddddd�dddddd�dddddd�d d d!ddd�ed"�Ze�r"d#d#d$d%d&d�ed'<d#d#d(d)d&d�ed*<d2ZGd0d1�d1e�ZdS)3zFdistutils.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-packagesz3$platbase/lib/python$py_version_short/site-packagesz9$base/include/python$py_version_short$abiflags/$dist_namez	$base/binz5$base/local/lib/python$py_version_short/dist-packagesz9$platbase/local/lib/python$py_version_short/dist-packagesz6$base/local/include/python$py_version_short/$dist_namez$base/local/binz$base/localz$base/lib/python3/dist-packagesz#$platbase/lib/python3/dist-packagesz0$base/include/python$py_version_short/$dist_namez$base/lib/pythonz$base/include/python/$dist_name)�unix_prefix�
unix_local�
deb_system�	unix_home�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_userrrrrrc@s<eZdZdZdadbdcdddfdgdhdidkdldmdndodpdqdrdsdtdugZdd%d(gZerbejd.dd/ef�ejd.�d diZ	d0d1�Z
d2d3�Zd4d5�Zd6d7�Z
d8d9�Zd:d;�Zd<d=�Zd>d?�Zd@dA�ZdBdC�ZdDdE�ZdFdG�ZdHdI�ZdJdK�ZdLdM�ZdNdO�ZdPdQ�ZdRdS�ZdTdU�ZdVdW�ZdXdY�ZdZefd[efd\efd]efd^d_d`�fgZdS)v�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)�install-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 distributions�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�install-layout=�7installation layout to choose (known values: deb, unix)�userz!install in user site-package '%s'cCs�d|_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|_d|_d|_dS)zInitializes options.Nr�)�prefix�exec_prefix�homerB�
prefix_option�install_base�install_platbase�root�install_purelib�install_platlib�install_headers�install_lib�install_scripts�install_datar
�install_userbaser�install_usersite�install_layout�	multiarchr1�optimize�
extra_path�install_path_filer9�
skip_build�warn_dir�
build_base�	build_lib�record)�self�r^�//usr/lib/python3.6/distutils/command/install.py�initialize_options�s8zinstall.initialize_optionscCsx|js|js|jr&|js|jr&td%��|jr@|js8|jr@td��|jrl|jsd|jsd|jsd|jsd|jrltd��tjdkr�|jr�|j	d�d|_|j
d�tjdkr�|j�n|j�|j
d	�t
jj�d
}tdd�\}}y
t
j}Wntk
r�d
}YnX|jj�|jj�|jj�|dt
jdd�dt
jdd�|||||d�|_t�rf|j|jd<|j|jd<|j�|j
d�|j|jd<|j|jd<t�r�d
dlm}td�||j�|j �|j
d�|j�r�|j!�|j"dk�r�|jj#�r�|j$|_"n|j%|_"|j&dddddddd�|j'�|j"|_(tj)j*|j"|j+�|_"|j,dk	�r\|j-d dddddd�|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}()rrDrE�z%d.%d�z%d%d)Z	dist_nameZdist_versionZ
dist_fullname�
py_versionZpy_version_shortZpy_version_nodotZ
sys_prefixrDZsys_exec_prefixrE�abiflagsZuserbaseZusersitezpost-expand_basedirs()�baseZplatbase)�pprintzconfig vars:zpost-expand_dirs()ZlibrrrrrZlibbasezafter prepending root�buildrZr[zWmust supply either prefix/exec-prefix/home or install-base/install-platbase -- not both)rZrZ)r[r[)/rDrErFrHrIrrB�os�name�warn�	dump_dirs�
finalize_unix�finalize_other�sys�version�splitrre�AttributeError�distributionZget_nameZget_versionZget_fullname�version_info�config_vars�
HAS_USER_SITErQrR�expand_basedirsrrg�print�expand_dirs�create_home_pathrNZext_modulesrLrK�
convert_paths�handle_extra_path�install_libbase�path�join�
extra_dirsrJ�change_rootsZset_undefined_options)r]rdrDrErergr^r^r_�finalize_options�s�

















zinstall.finalize_optionscCs�tsdSddlm}tj|d�x||jD]r}|d}|ddkrN|dd	�}||jkrz|j|}|j|�}t||�}n|j|�}t||�}tjd||�q*WdS)
zDumps the list of user options.Nr)�
longopt_xlate�:rC�=z  %s: %s���r�)	rZdistutils.fancy_getoptr�r�debug�user_options�negative_opt�	translate�getattr)r]�msgr�ZoptZopt_name�valr^r^r_rl�s




zinstall.dump_dirscCs|jdk	s|jdk	r\|jdkr2|jdkr2|jdksP|jdksP|jdksP|jdkrXtd��dS|j	r�|j
dkrttd��|j
|_|_|jd��n~|j
dk	r�|j
|_|_|jd��nX|j|_|jdkr�|jdk	r�td��tjjtj�|_tjjtj�|_n|jdk�r|j|_|j|_|j|_|j�r~|jj�dk�rXddl}|jd	�|_|jd
�n$|jj�dk�rt|jd�ntd
��n�|j�r�tjj|j�dk�s�tjtjk�s�dtjk�s�dtjk�s�dtjk�r�|jd�n6tjj|j�dk�rd|_|_d|_|_|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 prefix�debrZ	MULTIARCHr�unixrz"unknown value for --install-layoutz
/usr/localZPYTHONUSERBASEZVIRTUAL_ENVZreal_prefixz/usrr)r�)r�)rHrIrNrKrLrMrOrPrrBrQr�
select_schemerFrDrGrErir~�normpathrorS�lower�	sysconfigZget_config_varrT�base_prefix�environ�__dict__)r]r�r^r^r_rm�sd









zinstall.finalize_unixcCs�|jr8|jdkrtd��|j|_|_|jtjd�n�|jdk	r\|j|_|_|jd�n\|j	dkrvtj
jtj	�|_	|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')rBrQrrHrIr�rirjrFrDr~r�ro�KeyError)r]r^r^r_rn�s"


zinstall.finalize_othercCs@t|}x2tD]*}d|}t||�dkrt||||�qWdS)z=Sets the install directories by applying the install schemes.�install_N)�INSTALL_SCHEMES�SCHEME_KEYSr��setattr)r]rjZscheme�keyZattrnamer^r^r_r��s

zinstall.select_schemecCs\xV|D]N}t||�}|dk	rtjdks0tjdkr<tjj|�}t||j�}t|||�qWdS)Nrar)r�rirjr~�
expanduserr	rur�)r]Zattrs�attrr�r^r^r_�
_expand_attrs�s

zinstall._expand_attrscCs|jdddg�dS)zNCalls `os.path.expanduser` on install_base, install_platbase and
        root.rHrIrJN)r�)r]r^r^r_rwszinstall.expand_basedirscCs|jddddddg�dS)z+Calls `os.path.expanduser` on install dirs.rKrLrNrMrOrPN)r�)r]r^r^r_ry	szinstall.expand_dirscGs0x*|D]"}d|}t||tt||���qWdS)z!Call `convert_path` over `names`.r�N)r�rr�)r]�namesrjr�r^r^r_r{s
zinstall.convert_pathscCs�|jdkr|jj|_|jdk	r�tjd�t|jt�rB|jjd�|_t|j�dkr`|jd}}n"t|j�dkrz|j\}}ntd��t	|�}nd}d}||_
||_dS)	z4Set `path_file` and `extra_dirs` using `extra_path`.NzIDistribution option extra_path is deprecated. See issue27919 for details.�,rCrrczY'extra_path' option must be a list, tuple, or comma-separated string with 1 or 2 elementsrb)rVrsrrk�
isinstance�strrq�lenrr�	path_filer�)r]r�r�r^r^r_r|s$



zinstall.handle_extra_pathc	Gs4x.|D]&}d|}t||t|jt||���qWdS)z:Change the install directories pointed by name using root.r�N)r�r
rJr�)r]r�rjr�r^r^r_r�7s
zinstall.change_rootscCsh|js
dSttjjd��}xH|jj�D]:\}}|j|�r&tjj|�r&|j	d|�tj
|d�q&WdS)zCreate directories under ~.N�~zos.makedirs('%s', 0o700)i�)rBrrir~r�ru�items�
startswith�isdirZdebug_print�makedirs)r]rFrjr~r^r^r_rz=szinstall.create_home_pathcCs,|js6|jd�|jjd�j}|jr6|t�kr6td��x|j�D]}|j|�q@W|j	r`|j
�|jr�|j�}|j
r�t|j
�}x(tt|��D]}|||d�||<q�W|jt|j|fd|j�ttjjtj�}ttjj|�}tjjtjj|j��}|j�r(|j	�o
|j�r(||k�r(tjd|j�dS)zRuns the command.rhz"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)rXZrun_commandrsZget_command_objZ	plat_namerYrr�get_sub_commandsr��create_path_filer\�get_outputsrJr��range�executer�maprir~r�ro�normcaserNrWrr�)r]Z
build_plat�cmd_name�outputsZroot_lenZcounterZsys_pathrNr^r^r_�runIs6



zinstall.runcCsJtjj|j|jd�}|jr8|jt||jgfd|�n|j	d|�dS)zCreates the .pth filez.pthzcreating %szpath file '%s' not createdN)
rir~rr}r�rWr�rr�rk)r]�filenamer^r^r_r�us

zinstall.create_path_filecCspg}x>|j�D]2}|j|�}x"|j�D]}||kr&|j|�q&WqW|jrl|jrl|jtjj|j	|jd��|S)z.Assembles the outputs of all the sub-commands.z.pth)
r��get_finalized_commandr��appendr�rWrir~rr})r]r�r��cmdr�r^r^r_r��s
zinstall.get_outputscCs2g}x(|j�D]}|j|�}|j|j��qW|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|jj�p|jj�S)zSReturns true if the current distribution has any Python
        modules to install.)rsZhas_pure_modulesZhas_ext_modules)r]r^r^r_�has_lib�s
zinstall.has_libcCs
|jj�S)zLReturns true if the current distribution has any headers to
        install.)rs�has_headers)r]r^r^r_r��szinstall.has_headerscCs
|jj�S)zMReturns true if the current distribution has any scripts to.
        install.)rs�has_scripts)r]r^r^r_r��szinstall.has_scriptscCs
|jj�S)zJReturns true if the current distribution has any data to.
        install.)rsZhas_data_files)r]r^r^r_�has_data�szinstall.has_datarNrMrOrPZinstall_egg_infocCsdS)NTr^)r]r^r^r_�<lambda>�szinstall.<lambda>)rNr)rNr)rNr )r!Nr"�\base installation directory for platform-specific files (instead of --exec-prefix or --home))r#Nr�)r$Nr%)r&Nr')r(Nr)�ginstallation directory for all module distributions (overrides --install-purelib and --install-platlib))r*Nr�)r+Nr,)r-Nr.)r/Nr0)r1r2r3)r4Nr5)r6r7r8)r9r:r;)r<Nr=)r>Nr?)r@NrA) �__name__�
__module__�__qualname__Zdescriptionr�Zboolean_optionsrvr�rr�r`r�rlrmrnr�r�rwryr{r|r�rzr�r�r�r�r�r�r�r�Zsub_commandsr^r^r^r_rWs�

S>		",r)rrrrr)�__doc__roriZ	distutilsrZdistutils.corerZdistutils.debugrZdistutils.sysconfigrZdistutils.errorsrZdistutils.file_utilrZdistutils.utilrr	r
rrZsiter
rrvZWINDOWS_SCHEMEr�r�rr^r^r^r_�<module>sj

Zerion Mini Shell 1.0