HEX
Server: Apache
System: Linux srv1.prosuiteplus.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: prosuiteplus (1001)
PHP: 8.3.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/wheel/cli/__pycache__/convert.cpython-38.pyc
U

�-^%�@s�ddlZddlZddlZddlZddlZddlZddlmZddl	m
Z
ddlmZddlm
Z
ddlmZmZe�d	ej�ZGd
d�de�Zdd
�Zdd�Zdd�Zdd�ZdS)�N)�dist)�iglob�)�bdist_wheel)�	WheelFile�)�
WheelError�require_pkgresourcesz]
    (?P<name>.+?)-(?P<ver>.+?)
    (-(?P<pyver>py\d\.\d+)
     (-(?P<arch>.+?))?
    )?.egg$c@seZdZdZdZdd�ZdS)�_bdist_wheel_tagFNcCs$|jr|jdk	r|jSt�|�SdS)N)�full_tag_supplied�full_tagr�get_tag)�self�r�3/usr/lib/python3/dist-packages/wheel/cli/convert.pyr
sz_bdist_wheel_tag.get_tag)�__name__�
__module__�__qualname__rrr
rrrrr
sr
c	Cs�tj�|�}t�|�}|s(td�|���|��}tj	dd�}tj�
|�rjt�|��}|�
|�W5QRXnNt�|�D]B}tj�||�}tj�
|�r�t�||�qtt�|tj�||��qt|d}	|	r�|	�dd�}	|d<|dp�d�dd	��d
d	�}
|
dk�rd|	dd�nd
}|ddk}|�r2tt���}
ntt���}
||
_|	|
_d|
_|d�p\d|
_|�sxd|
_|	||
f|
_tj�|djf|��}|
�tj�|d�|�|
j|dd�dj||
f|�}t tj�||�d��}|�!|�W5QRXt�"|�dS)NzInvalid egg file name: {}Z_e2w��suffix�pyver�.��arch�any�_�-�cpr�noneTz{name}-{ver}.dist-infozEGG-INFO�	egg2wheel��	generatorz{name}-{ver}-{pyver}-{}-{}.whl�w)#�os�path�basename�egg_info_re�matchr�format�	groupdict�tempfile�mkdtemp�isfile�zipfile�ZipFile�
extractall�listdir�join�shutilZcopy2Zcopytree�replacerr�Distributionr
�root_is_pure�
python_tag�plat_name_supplied�	plat_namerr�egg2dist�write_wheelfiler�write_files�rmtree)Zegg_path�dest_dir�filenamer'Zegg_info�dirZeggZpth�srcrr�abi�root_is_purelib�bw�
dist_info_dir�
wheel_name�wfrrrr%sJ
rc
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 validrz"Installer filename %s is not valid����pyrrzpy2.py3�name�ver)rIrJrr)r&�search�
ValueError�	partition�
rpartition�
startswithr3�group)
Zwininfo_name�egginfo_nameZegginfoZw_name�sep�restZrest2Zw_pyverZw_verZw_archrrr�parse_wininst_info[s*!


rTc	Cs�t�|���V}d}|��D]}d|kr|}q0qttj�|�|�}d}|��D]}|j�	d�rNd}qhqN|rvddi}nddi}d|}	d	|	}
g}d}|��D]�}|j�
d
d�\}}
|��}|�|d�}|dkr�|
|��d
}|j}||
}||_|j
|=||j
|<|�r|�|�|s�|�d��r,|}q�d|kr�|�d
�\}}}q�tjd
d�}|�||�W5QRXd}|d}|d�p�d�dd��dd�}|�r�d}|dk�r�|�dd�}d�|	|||f�}|�r�tt���}ntt���}||_||_d|_|d�pd|_|�sd|_|||f|_tj�|d|	�}|� tj�||�|�|j!|dd�tj�||�}t"|d��}|�#|�W5QRXt$�%|�dS)Nz	.egg-infoTZPLATLIBFZpurelibrZplatlibz%(name)s-%(ver)sz%s.data/�/rz
.egg-info/Z_b2wrrrrrrrrrHrz%s.dist-info�
wininst2wheelr r")&r-r.ZnamelistrTr#r$r%Zinfolistr>rO�split�lower�getZ
NameToInfo�append�endswithrNr*r+r/r3r1rrr4r
r5r6r7r8rrr9r:rr;r2r<)r$r=ZbdwrQr>�inforBZzipinfo�pathsZ	dist_infoZdatadir�members�keyr%ZbasepathZoldnameZnewnamerRrr?rArrrErCrDZ
wheel_pathrFrrrrV�s�



rVcCsttd�|D]b}t|�D]T}tj�|�ddkr6t}nt}|rVtd�|��t	j
��|||�|rtd�qqdS)Nz
wheel convertrz.eggz{}... ZOK)r	rr#r$�splitextrrV�printr(�sys�stdout�flush)�filesr=�verboseZpatZ	installerZconvrrr�convert�s

rg)�os.pathr#�rer2rbr*r-Z	distutilsr�globrrZ	wheelfilerrrr	�compile�VERBOSEr&r
rrTrVrgrrrr�<module>s$�6GZ