AlkantarClanX12

Your IP : 18.116.40.151


Current Path : /opt/alt/python35/lib64/python3.5/distutils/command/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/distutils/command/__pycache__/bdist_wininst.cpython-35.opt-2.pyc



���]�;�@s�ddlZddlZddlmZddlmZddlmZmZddl	Tddl
mZddlm
Z
Gdd	�d	e�ZdS)
�N)�Command)�get_platform)�create_tree�remove_tree)�*)�get_python_version)�logc@s�eZdZdZd4ddde�fdd	d
dfddd
dfd5d6d7d8d9d:d;d<d=g
ZddddgZd&d'�Zd(d)�Zd*d+�Z	d,d-�Z
dd.d/�Zd0d1�Zd2d3�Z
dS)>�
bdist_wininstz-create an executable installer for MS Windows�
bdist-dir=N�1temporary directory for creating the distributionz
plat-name=�pz;platform name to embed in generated filenames (default: %s)z	keep-temp�kz/keep the pseudo-installation tree around after z!creating the distribution archiveztarget-version=z!require a specific python versionz on the target system�no-target-compile�c�/do not compile .py to .pyc on the target system�no-target-optimize�o�:do not compile .py to .pyo (optimized)on the target system�	dist-dir=�d�-directory to put final built distributions in�bitmap=�b�>bitmap to use for the installer instead of python-powered logo�title=�t�?title to display on the installer background instead of default�
skip-build�2skip rebuilding everything (for testing/debugging)�install-script=�Tbasename of installation script to be run afterinstallation or before deinstallation�pre-install-script=�{Fully qualified filename of a script to be run before any files are installed.  This script need not be in the distribution�user-access-control=��specify Vista's UAC handling - 'none'/default=no handling, 'auto'=use UAC if target Python installed for all users, 'force'=always use UACcCsyd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_dS)Nr)
�	bdist_dir�	plat_name�	keep_temp�no_target_compile�no_target_optimize�target_version�dist_dir�bitmap�title�
skip_build�install_script�pre_install_script�user_access_control)�self�r3�2/opt/alt/python35/lib64/python3.5/bdist_wininst.py�initialize_options:s												z bdist_wininst.initialize_optionscCsG|jdd	�|jdkry|jrO|jrO|jjd�}|j|_|jd�j}tj	j
|d�|_|js�d|_|jr�|jj�r�t
�}|jr�|j|kr�td|f��||_|jdd
d�|jrCxC|jjD]"}|jtj	j|�kr
Pq
Wtd|j��dS)N�bdistr.Zwininst�zMtarget version can only be %s, or the '--skip-build' option must be specifiedr+r&z(install_script '%s' not found in scripts)r.r.)r+r+)r&r&)Zset_undefined_optionsr%r.r&�distributionZget_command_obj�get_finalized_command�
bdist_base�os�path�joinr*�has_ext_modulesrZDistutilsOptionErrorr/�scripts�basename)r2r6r:Z
short_version�scriptr3r3r4�finalize_optionsJs4			
			zbdist_wininst.finalize_optionsc
Cs�tjdkr9|jj�s-|jj�r9td��|jsO|jd�|jddd�}|j	|_
|j|_d|_|j|_|jd�}d|_
d|_|jj�r$|j}|s�tjdd	�}d
|j|f}|jd�}tjj|jd|�|_xDdD]<}|j�}|dkrS|d}t|d||�q+Wtjd|j	�|j�tjjdtjj|j	d��|j�tjd=ddlm}|�}	|jj �}
|j!|	dd|j	�}|j"||
|j#�|jj�r5t$�}nd}|jj%j&d||j'|
�f�tj(d|�tj)|�|j*s�t+|j	d|j,�dS)N�win32z^distribution contains extensions and/or C libraries; must be compiled on a Windows 32 platform�build�installZreinit_subcommands�r�install_lib�z.%s-%s�lib�purelib�platlib�headersr?�dataz/Include/$dist_nameZinstall_zinstalling to %sZPURELIB)�mktemp�zip�root_dir�anyr	zremoving temporary file '%s'�dry_run)rJrKrLr?rM)-�sys�platformr8r>Zhas_c_librariesZDistutilsPlatformErrorr.Zrun_commandZreinitialize_commandr%�rootZwarn_dirr&�compile�optimizer*�versionr9r;r<r=Z
build_baseZ	build_lib�upper�setattrr�infoZensure_finalized�insert�run�tempfilerN�get_fullname�make_archive�
create_exer,rZ
dist_files�append�get_installer_filename�debug�remover'rrR)
r2rErGr*Zplat_specifierrD�key�valuerNZarchive_basename�fullname�arcnameZ	pyversionr3r3r4r]psd		
				


%

	
	zbdist_wininst.runcCs�g}|jj}|jd�|jp+dd}dd�}x{dddd	d
ddd
gD][}t||d�}|r]|d|j�||�f}|jd|||�f�q]W|jd�|jr�|jd|j�|jd||��|jd|j�|jd|j�|j	rD|jd|j	�|j
ra|jd|j
�|jpv|jj�}|jd||��ddl
}ddl}	d|j|j
��|	jf}
|jd|
�dj|�S)Nz
[metadata]r7�
cSs|jdd�S)Nrjz\n)�replace)�sr3r3r4�escape�sz)bdist_wininst.get_inidata.<locals>.escapeZauthorZauthor_email�descriptionZ
maintainerZmaintainer_email�nameZurlrXz
    %s: %sz%s=%sz
[Setup]zinstall_script=%szinfo=%sztarget_compile=%dztarget_optimize=%dztarget_version=%szuser_access_control=%sztitle=%srzBuilt %s with distutils-%sz
build_info=%s)r8�metadatarbZlong_description�getattr�
capitalizer/r(r)r*r1r-r_�time�	distutils�ctime�__version__r=)r2�linesrpr[rmrorMr-rsrtZ
build_infor3r3r4�get_inidata�s<
!
			zbdist_wininst.get_inidatac
Cs�ddl}|j|j�|j�}|j|�}|jd|�|rrt|d�j�}t|�}nd}t|d�}	|	j	|j
��|r�|	j	|�t|t�r�|j
d�}|d}|jr&t|jddd	��}
|
j�j
d	�}WdQRX||d
}n
|d}|	j	|�|jddt|�|�}|	j	|�|	j	t|d�j��dS)
Nrzcreating %s�rb�wb�mbcss�r�encodingzlatin-1s
z<iiii{V4)�structZmkpathr+rxrcZannounce�open�read�len�write�
get_exe_bytes�
isinstance�str�encoder0�pack)
r2rirhr,r~Zcfgdata�installer_nameZ
bitmapdataZ	bitmaplen�filerAZscript_data�headerr3r3r4ra�s:

	

			
zbdist_wininst.create_execCs`|jr7tjj|jd||j|jf�}n%tjj|jd||jf�}|S)Nz%s.%s-py%s.exez	%s.%s.exe)r*r;r<r=r+r&)r2rhr�r3r3r4rc$s	z$bdist_wininst.get_installer_filenamecCs�t�}|jr�|j|kr�|jdkr9d}q�|jdkrQd}q�|jdkrid}q�|jdkr�d}q�|jdkr�d	}q�d
}nZyddlm}Wntk
r�d
}Yn,Xtd
j|jd
d�dd���}tj	j
t�}|jdkrL|jdd�dkrL|jdd�}nd}tj	j|d||f�}t
|d�}z|j�SWd|j�XdS)Nz2.4g@gffffff@z2.5g @z3.2g"@z3.4g$@g,@r)�CRT_ASSEMBLY_VERSION�.�rCrH�winr7zwininst-%.1f%s.exery)rr*�msvcrtr��ImportError�floatr=�splitr;r<�dirname�__file__r&rr��close)r2Zcur_versionZbvr�Z	directoryZsfix�filename�fr3r3r4r�1s6								
+(zbdist_wininst.get_exe_bytes)r
Nr)rrr)rrr)rrr)rrr)rrr)rNr)rNr )r!Nr")r#Nr$)�__name__�
__module__�__qualname__rnrZuser_optionsZboolean_optionsr5rBr]rxrarcr�r3r3r3r4r	sN
			&Q.5
r	)rSr;Zdistutils.corerZdistutils.utilrZdistutils.dir_utilrrZdistutils.errorsZdistutils.sysconfigrrtrr	r3r3r3r4�<module>s