Edit File: bdist_wininst.cpython-36.opt-1.pyc
3 48e�<������������������@���sp���d�Z�ddlZddlZddlmZ�ddlmZ�ddlmZm Z �ddl T�ddlmZ�ddl mZ�G�d d ��d e�ZdS�)zzdistutils.command.bdist_wininst Implements the Distutils 'bdist_wininst' command: create a windows installer exe-program.�����N)�Command)�get_platform)�create_tree�remove_tree)�*)�get_python_version)�logc���������������@���s����e�Zd�ZdZd5ddde���fd7d9d:d;d<d=d>d?d@dAdBg ZddddgZejd&kZ d'd(��Z d)d*��Zd+d,��Zd-d.��Z dCd/d0�Zd1d2��Zd3d4��ZdS�)D� 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)� keep-temp�kz/keep the pseudo-installation tree around after z!creating the distribution archive�target-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=�Ubasename of installation script to be run after installation 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 UAC�win32c�������������C���sR���d�|�_�d�|�_d|�_d|�_d|�_d�|�_d�|�_d�|�_d�|�_d�|�_ d�|�_ d�|�_d�|�_d�S�)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��r6����7/usr/lib64/python3.6/distutils/command/bdist_wininst.py�initialize_options=���s����z bdist_wininst.initialize_optionsc�������������C���s����|�j�dd ��|�jd�krR|�jr6|�jr6|�jjd�}|�j|_|�jd�j}tj j |d�|�_|�js^d|�_|�j�r�|�jj��r�t ��}|�jr�|�j|kr�td|f���||�_|�j�dd d��|�jr�x2|�jjD�]}|�jtj j|�kr�P�q�W�td|�j���d�S�)N�bdistr1���Zwininst��zMtarget version can only be %s, or the '--skip-build' option must be specifiedr.���r)���z(install_script '%s' not found in scripts)r1���r1���)r.���r.���)r)���r)���)Zset_undefined_optionsr(���r1���r)����distributionZget_command_obj�get_finalized_command� bdist_base�os�path�joinr-����has_ext_modulesr���ZDistutilsOptionErrorr2����scripts�basename)r5���r9���r=���Z short_version�scriptr6���r6���r7����finalize_optionsM���s4���� zbdist_wininst.finalize_optionsc������� ������C���s���t�jdkr&|�jj��s|�jj��r&td��|�js6|�jd��|�jddd�}|�j |_ |�j|_d|_|�j|_|�jd�}d|_ d|_|�jj��r�|�j}|s�d t�jd�d ���}d|�j|f�}|�jd�}tjj|jd|��|_x4dD�],}|j��}|dkr�|d�}t|d|�|��q�W�tjd|�j ��|j���t�jjdtjj|�j d���|j���t�jd=�ddlm}�|��} |�jj ��} |�j!| d|�j d�}|�j"|| |�j#��|�jj���r�t$��}nd}|�jj%j&d||�j'| �f��tj(d|��tj)|��|�j*�s�t+|�j |�j,d��d�S�)Nr'���z^distribution contains extensions and/or C libraries; must be compiled on a Windows 32 platform�build�install����)Zreinit_subcommandsr����install_libz%d.%d����z.%s-%s�lib�purelib�platlib�headersrB����dataz/Include/$dist_nameZinstall_zinstalling to %sZPURELIB)�mktemp�zip)Zroot_dir�anyr ���zremoving temporary file '%s')�dry_run)rL���rM���rN���rB���rO���)-�sys�platformr;���rA���Zhas_c_librariesZDistutilsPlatformErrorr1���Zrun_commandZreinitialize_commandr(����rootZwarn_dirr)����compile�optimizer-����version_infor<���r>���r?���r@���Z build_baseZ build_lib�upper�setattrr����infoZensure_finalized�insert�runZtempfilerP����get_fullnameZmake_archive� create_exer/���r���Z dist_files�append�get_installer_filename�debug�remover*���r���rS���) r5���rG���rI���r-���Zplat_specifierrF����key�valuerP���Zarchive_basename�fullname�arcnameZ pyversionr6���r6���r7���r^���s���sd���� zbdist_wininst.runc�������������C���s`��g�}|�j�j}|jd��|jpdd�}dd��}xJdD�]B}t||d�}|r2|d|j��||�f��}|jd|||�f���q2W�|jd��|�jr�|jd|�j���|jd||����|jd|�j����|jd|�j����|�j r�|jd|�j ���|�j ��r�|jd|�j ���|�j�p|�j�j��}|jd||����dd�l }dd�l} d|j|j ���| jf�} |jd| ���dj|�S�)Nz [metadata]r:���� c�������������S���s���|�j�dd�S�)Nri���z\n)�replace)�sr6���r6���r7����escape����s����z)bdist_wininst.get_inidata.<locals>.escape�author�author_email�description� maintainer�maintainer_email�name�url�versionz %s: %sz%s=%sz [Setup]zinstall_script=%szinfo=%sztarget_compile=%dztarget_optimize=%dztarget_version=%szuser_access_control=%sztitle=%sr���zBuilt %s with distutils-%sz build_info=%s)rm���rn���ro���rp���rq���rr���rs���rt���)r;����metadatara���Zlong_description�getattr� capitalizer2���r+���r,���r-���r4���r0���r_����time� distutilsZctime�__version__r@���)r5����linesru���r\���rl���rr���rO���r0���rx���ry���Z build_infor6���r6���r7����get_inidata����s<���� zbdist_wininst.get_inidatac������� ������C���s��dd�l�}|�j|�j��|�j��}|�j|�}|�jd|���|rPt|d�j��}t|�}nd}t|d�} | j |�j ����|rz| j |��t|t�r�|j d�}|d�}|�jr�t|�jddd ��} | j��j d�}W�d�Q�R�X�||�d �}n|d�}| j |��|jddt|�|�}| j |��| j t|d�j����d�S�) Nr���zcreating %s�rb�wb�mbcs������rzlatin-1)�encodings��� �z<iiii{V4)�structZmkpathr.���r|���rb���Zannounce�open�read�len�write� get_exe_bytes� isinstance�str�encoder3���Zpack) r5���rh���rg���r/���r����Zcfgdata�installer_nameZ bitmapdataZ bitmaplen�filerD���Zscript_data�headerr6���r6���r7���r`�������s:���� zbdist_wininst.create_exec�������������C���sD���|�j�r&tjj|�jd||�j|�j�f��}ntjj|�jd||�jf��}|S�)Nz%s.%s-py%s.exez %s.%s.exe)r-���r>���r?���r@���r.���r)���)r5���rg���r����r6���r6���r7���rb���'��s���� z$bdist_wininst.get_installer_filenamec������� ������C���s ��t���}|�jrl|�j|k�rl|�jdk�r&d}q�|�jdkr6d}q�|�jdkrFd}q�|�jdkrVd}q�|�jdkrfd }q�d }n@yddlm}�W�n�tk r����d }Y�nX�|jd �d�}|d�}tjjt �}|�j dkr�|�j d�d��dkr�|�j dd���}nd}tjj|d||f��}t|d�}z|j ��S�|j���X�d�S�)Nz2.4z6.0z7.1z2.5z8.0z3.2z9.0z3.4z10.0z14.0r���)�CRT_ASSEMBLY_VERSION�.z.0r'��������winr:���zwininst-%s%s.exer}���)r���r-���Zmsvcrtr�����ImportError� partitionr>���r?����dirname�__file__r)���r@���r����r�����close) r5���Zcur_versionZbvr�����majorZ directoryZsfix�filename�fr6���r6���r7���r����4��s8���� zbdist_wininst.get_exe_bytes)r ���Nr����Pkeep the pseudo-installation tree around after creating the distribution archive)r ���r���r�����6require a specific python version on the target system)r���Nr����)r���r���r���)r���r���r���)r���r���r���)r���r���r���)r���r���r���)r���Nr ���)r!���Nr"���)r#���Nr$���)r%���Nr&���)N)�__name__� __module__�__qualname__ro���r���Zuser_optionsZboolean_optionsrT���rU���Z_unsupportedr8���rE���r^���r|���r`���rb���r����r6���r6���r6���r7���r ������sP����������������� &Q. 5 r ���)�__doc__rT���r>���Zdistutils.corer���Zdistutils.utilr���Zdistutils.dir_utilr���r���Zdistutils.errorsZdistutils.sysconfigr���ry���r���r ���r6���r6���r6���r7����<module>���s���