AlkantarClanX12

Your IP : 18.188.119.67


Current Path : /usr/lib64/python3.8/distutils/command/__pycache__/
Upload File :
Current File : //usr/lib64/python3.8/distutils/command/__pycache__/bdist_wininst.cpython-38.opt-2.pyc

U

e5d�>�@stddlZddlZddlZddlmZddlmZddlmZm	Z	ddl
TddlmZddl
mZGdd	�d	e�ZdS)
�N)�Command)�get_platform)�create_tree�remove_tree)�*)�get_python_version)�logc
s�eZdZdZdddde�fdddd	d
ddd
dddg
ZddddgZejdkZ	�fdd�Z
dd�Zdd�Zdd�Z
dd�Zd'd!d"�Zd#d$�Zd%d&�Z�ZS)(�
bdist_wininstz-create an executable installer for MS Windows)z
bdist-dir=Nz1temporary directory for creating the distributionz
plat-name=�pz;platform name to embed in generated filenames (default: %s))�	keep-temp�kzPkeep the pseudo-installation tree around after creating the distribution archive)ztarget-version=Nz6require a specific python version on the target system)�no-target-compile�cz/do not compile .py to .pyc on the target system)�no-target-optimize�oz;do not compile .py to .pyo (optimized) on the target system)z	dist-dir=�dz-directory to put final built distributions in)zbitmap=�bz>bitmap to use for the installer instead of python-powered logo)ztitle=�tz?title to display on the installer background instead of default)�
skip-buildNz2skip rebuilding everything (for testing/debugging))zinstall-script=NzUbasename of installation script to be run after installation or before deinstallation)zpre-install-script=Nz{Fully qualified filename of a script to be run before any files are installed.  This script need not be in the distribution)zuser-access-control=Nz�specify Vista's UAC handling - 'none'/default=no handling, 'auto'=use UAC if target Python installed for all users, 'force'=always use UACrr
rr�win32cs t�j||�t�dtd�dS)Nz^bdist_wininst command is deprecated since Python 3.8, use bdist_wheel (wheel packages) instead�)�super�__init__�warnings�warn�DeprecationWarning)�self�args�kw��	__class__��7/usr/lib64/python3.8/distutils/command/bdist_wininst.pyr?s
�zbdist_wininst.__init__cCsRd|_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)rr!r!r"�initialize_optionsEsz bdist_wininst.initialize_optionscCs�|�dd�|jdkrR|jr6|jr6|j�d�}|j|_|�d�j}tj	�
|d�|_|js^d|_|js�|j��r�t
�}|jr�|j|kr�td|f��||_|�ddd�|jr�|jjD]}|jtj	�|�kr�q�q�td|j��dS)	N�bdist)r,r,Zwininst�zMtarget version can only be %s, or the '--skip-build' option must be specified)r)r))r$r$z(install_script '%s' not found in scripts)Zset_undefined_optionsr#r,r$�distributionZget_command_obj�get_finalized_command�
bdist_base�os�path�joinr(�has_ext_modulesrZDistutilsOptionErrorr-�scripts�basename)rr1r5Z
short_version�scriptr!r!r"�finalize_optionsUs>
�����zbdist_wininst.finalize_optionsc
Cs�tjdkr&|j��s|j��r&td��|js6|�d�|jddd�}|j	|_
|j|_d|_|j|_|�d�}d|_
d|_|j��r�|j}|s�d	tjdd
�}d|j|f}|�d�}tj�|jd|�|_d
D],}|��}|dkr�|d}t|d||�q�t�d|j	�|��tj�dtj�|j	d��|��tjd=ddlm}|�}	|j� �}
|j!|	d|j	d�}|�"||
|j#�|j���r�t$�}nd}|jj%�&d||�'|
�f�t�(d|�t�)|�|j*�s�t+|j	|j,d�dS)Nrz^distribution contains extensions and/or C libraries; must be compiled on a Windows 32 platform�build�install�)Zreinit_subcommandsr�install_libz%d.%drz.%s-%s�lib)ZpurelibZplatlib�headersr:�datarCz/Include/$dist_nameZinstall_zinstalling to %sZPURELIB)�mktemp�zip)Zroot_dir�anyr	zremoving temporary file '%s')�dry_run)-�sys�platformr3r9Zhas_c_librariesZDistutilsPlatformErrorr,Zrun_commandZreinitialize_commandr#�rootZwarn_dirr$�compile�optimizer(�version_infor4r6r7r8Z
build_baseZ	build_lib�upper�setattrr�infoZensure_finalized�insert�runZtempfilerE�get_fullnameZmake_archive�
create_exer*rZ
dist_files�append�get_installer_filename�debug�remover%rrH)
rr?rAr(Zplat_specifierr>�key�valuerEZarchive_basename�fullname�arcnameZ	pyversionr!r!r"rS{sr
���




��
��
zbdist_wininst.runcCsZg}|jj}|�d�|jpdd}dd�}dD]B}t||d�}|r0|d|��||�f}|�d|||�f�q0|�d	�|jr�|�d
|j�|�d||��|�d|j�|�d
|j�|j	r�|�d|j	�|j
r�|�d|j
�|j�p|j��}|�d||��ddl
}ddl}	d|�|�
��|	jf}
|�d|
�d�|�S)Nz
[metadata]r2�
cSs|�dd�S)Nr^z\n)�replace)�sr!r!r"�escape�sz)bdist_wininst.get_inidata.<locals>.escape)ZauthorZauthor_email�descriptionZ
maintainerZmaintainer_email�nameZurl�versionz
    %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)r3�metadatarVZlong_description�getattr�
capitalizer-r&r'r(r/r+rT�time�	distutils�ctime�__version__r8)r�linesrerQrarcrDr+rhriZ
build_infor!r!r"�get_inidata�s>
�
�zbdist_wininst.get_inidataNc
CsHddl}|�|j�|��}|�|�}|�d|�|r`t|d��}|��}W5QRXt|�}	nd}	t|d���}
|
�	|�
��|r�|
�	|�t|t�r�|�
d�}|d}|jr�t|jddd	��}|���
d�}W5QRX||d
}n|d}|
�	|�|�ddt|�|	�}
|
�	|
�t|d��}|
�	|���W5QRXW5QRXdS)
Nrzcreating %s�rb�wb�mbcs��rzlatin-1)�encodings
z<iiii{V4)�structZmkpathr)rmrWZannounce�open�read�len�write�
get_exe_bytes�
isinstance�str�encoder.Zpack)rr]r\r*rtZcfgdata�installer_name�fZ
bitmapdataZ	bitmaplen�filer<Zscript_data�headerr!r!r"rU�sD




�
�
zbdist_wininst.create_execCsD|jr&tj�|jd||j|jf�}ntj�|jd||jf�}|S)Nz%s.%s-py%s.exez	%s.%s.exe)r(r6r7r8r)r$)rr\r}r!r!r"rW1s
��
�z$bdist_wininst.get_installer_filenamec	Cs$t�}|jrl|j|krl|jdkr&d}q�|jdkr6d}q�|jdkrFd}q�|jdkrVd}q�|jdkrfd	}q�d
}n@zddlm}Wntk
r�d
}YnX|�d
�d}|d}tj�t	�}|j
dkr�|j
dd�dkr�|j
dd�}nd}tj�|d||f�}t|d�}z|��W�S|�
�XdS)Nz2.4z6.0z7.1z2.5z8.0z3.2z9.0z3.4z10.0z14.0r)�CRT_ASSEMBLY_VERSION�.z.0r��winr2zwininst-%s%s.exern)rr(Zmsvcrtr��ImportError�	partitionr6r7�dirname�__file__r$r8ru�closerv)	rZcur_versionZbvr��majorZ	directoryZsfix�filenamer~r!r!r"ry>s8	






zbdist_wininst.get_exe_bytes)N)�__name__�
__module__�__qualname__rbrZuser_optionsZboolean_optionsrIrJZ_unsupportedrr0r=rSrmrUrWry�
__classcell__r!r!rr"r	s>���%�
&Q.
7
r	)r6rIrZdistutils.corerZdistutils.utilrZdistutils.dir_utilrrZdistutils.errorsZdistutils.sysconfigrrirr	r!r!r!r"�<module>s