Your IP : 216.73.216.213


Current Path : /opt/alt/python37/lib/python3.7/site-packages/wheel/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/wheel/__pycache__/wininst2wheel.cpython-37.opt-1.pyc

B

Pp�cY�@s�ddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddlm
Z
ddlZddlmZe�dej�Zdd�Zejjfd	d
�ZGdd�dejj�Zd
d�Zedkr�e�dS)�N)�ArgumentParser)�iglob)�rmtree)�archive_wheelfilezX(^|/)(?P<name>[^/]+?)-(?P<ver>.+?)
    (-(?P<pyver>.+?))?(-(?P<arch>.+?))?.egg-info(/|$)c
Cs�d}|r$t�|�}|s$td|f��|�d�\}}}|sFtd|f��|dd�}|�d�\}}}|r�|�d�r�|}|�dd�}nd	}|�d�\}}}	|s�td|f��|r�|�d
�}|�d�}|||	|d�S)
atExtract metadata from filenames.

    Extracts the 4 metadataitems needed (name, version, pyversion, arch) from
    the installer filename and the name of the egg-info directory embedded in
    the zipfile (if any).

    The egginfo filename has the format::

        name-ver(-pyver)(-arch).egg-info

    The installer filename has the format::

        name-ver.arch(-pyver).exe

    Some things to note:

    1. The installer filename is not definitive. An installer can be renamed
       and work perfectly well as an installer. So more reliable data should
       be used whenever possible.
    2. The egg-info data should be preferred for the name and version, because
       these come straight from the distutils metadata, and are mandatory.
    3. The pyver from the egg-info data should be ignored, as it is
       constructed from the version of Python used to build the installer,
       which is irrelevant - the installer filename is correct here (even to
       the point that when it's not there, any version is implied).
    4. The architecture must be taken from the installer filename, as it is
       not included in the egg-info data.
    5. Architecture-neutral installers still have an architecture because the
       installer format itself (being executable) is architecture-specific. We
       should therefore ignore the architecture if the content is pure-python.
    Nz!Egg info filename %s is not valid�-z"Installer filename %s is not valid����py�.�zpy2.py3�name�ver)rr�arch�pyver)�egg_info_re�search�
ValueError�	partition�
rpartition�
startswith�replace�group)
Zwininfo_name�egginfo_nameZegginfoZw_name�sep�restZrest2Zw_pyverZw_verZw_arch�r�D/opt/alt/python37/lib/python3.7/site-packages/wheel/wininst2wheel.py�
parse_infos*!


rcCs�t�|�}d}x|��D]}d|kr|}PqWttj�|�|�}d}x"|��D]}|j�	d�rNd}PqNW|rvddi}nddi}d|}	d	|	}
g}d}x�|��D]�}|j�
d
d�\}}
|��}|�|d�}|dkr�|
|��d
}|j}||
}||_|j
|=||j
|<|�r|�|�|s�|�d��r.|}q�d|kr�|�d
�\}}}q�Wtjd
d�}|�||�d}|d}|d�pzd�dd��dd�}|�r�d}|dk�r�|�dd�}d�|	|||f�}|�r�tj�tj���}nttj���}||_||_d|_|d�pd|_|�s d|_ |||f|_!tj�|d|	�}|�"tj�||�|�|j#|dd�|�$||�t%tj�||�|�t&|�dS)Nz	.egg-infoTZPLATLIBFZpurelibr
Zplatlibz%(name)s-%(ver)sz%s.data/�/�z
.egg-info/Z_b2w)�suffixZnonerr
�anyr	�_rrZcpz%s.dist-infoZ
wininst2wheel)�	generator)'�zipfileZZipFileZnamelistr�os�path�basenameZinfolist�filenamer�split�lower�getZ
NameToInfo�append�endswithr�tempfileZmkdtempZ
extractallr�join�wheel�bdist_wheel�	distutilsZdistZDistribution�_bdist_wheel_tagZroot_is_pureZ
python_tagZplat_name_suppliedZ	plat_name�full_tag_supplied�full_tagZegg2distZwrite_wheelfileZwrite_recordrr)r%�dest_dirZbdwrr'�infoZroot_is_purelibZzipinfo�pathsZ	dist_infoZdatadir�members�keyr&ZbasepathZoldnameZnewnamerr!�dirZabirr
Z
wheel_nameZbwZ
dist_info_dirrrr�bdist_wininst2wheelYs�




r;cs$eZdZdZdZ�fdd�Z�ZS)r2FNcs(|jr|jdk	r|jStt|���SdS)N)r3r4�superr2�get_tag)�self)�	__class__rrr=�sz_bdist_wheel_tag.get_tag)�__name__�
__module__�__qualname__r3r4r=�
__classcell__rr)r?rr2�sr2cCs�t�}|jdddd�|jddtjjdd�|jd	d
dd�|��}xX|jD]N}xHt|�D]<}|jr|t	d
�
|��tj�
�t||j�|jrZt	d�qZWqLWdS)N�
installers�*zInstallers to convert)�nargs�helpz
--dest-dirz-dz/Directory to store wheels (default %(default)s))�defaultrGz	--verbosez-v�
store_true)�actionz{}... ZOK)r�add_argumentr$r%�curdir�
parse_argsrDr�verbose�print�format�sys�stdout�flushr;r5)�parser�argsZpatZ	installerrrr�main�s
rV�__main__)Zdistutils.distr1Zos.pathr$�rerQr-r#�argparserZglobrZshutilrZwheel.bdist_wheelr/Z
wheel.archiver�compile�VERBOSErrr%rLr;r0r2rVr@rrrr�<module>s$
G^