HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/wheel/cli/__pycache__/convert.cpython-310.pyc
o

��hZ1�@s~ddlmZddlZddlZddlmZmZddlm	Z	ddl
mZddlm
Z
ddlmZddlmZdd	lmZdd
lmZddlmZddlmZd
dlmZd
dlmZd
dlmZd
dl m!Z!e�"dej#�Z$e�"dej#�Z%e�"d�Z&e�"d�Z'edddd�Z(de��Z)d8d d!�Z*d9d#d$�Z+d:d&d'�Z,Gd(d)�d)ed*�Z-Gd+d,�d,e-�Z.Gd-d.�d.e.�Z/Gd/d0�d0e-�Z0d;d6d7�Z1dS)<�)�annotationsN)�ABCMeta�abstractmethod)�defaultdict)�Iterator)�Message)�Parser)�EmailPolicy)�iglob)�Path)�dedent)�ZipFile�)�__version__)�generate_requirements)�	parse_tag)�	WheelFilez]
    (?P<name>.+?)-(?P<ver>.+?)
    (-(?P<pyver>py\d\.\d+)
     (-(?P<arch>.+?))?
    )?.egg$zL
    ^(?P<name>.+?)-(?P<ver>.+?)
    (-(?P<pyver>py\d\.\d+)
    )?.egg-info/z>\.(?P<platform>win32|win-amd64)(?:-(?P<pyver>py\d\.\d))?\.exe$z8\.(?P<abi>[a-z0-9]+)-(?P<platform>win32|win_amd64)\.pyd$TF)�utf8�mangle_from_�max_line_lengthzwheel �requires�str�metadatar�return�NonecCszd}tt�}|��D]!}|��}|sq
|�d�r$|�d�r$|dd�}q
||�|�q
t|�D]
\}}|�||�q0dS)N�[�]����)	r�list�
splitlines�strip�
startswith�endswith�appendr�
add_header)rr�extra�requirements�line�key�value�r+�</usr/local/lib/python3.10/dist-packages/wheel/cli/convert.py�convert_requires0s�r-�pkginfoc
Cs�t��|�}|��D]R\}}|��}|dkrq
|dkr:|��}d�|d��td�|dd���df�}|�|�q
|dkrH|�	dd|���q
|d	krV|�	dd
|���q
|�	||�q
|�
dd�dS)
N�UNKNOWN�description�
rrz	home-pagezProject-URLz
Homepage, zdownload-urlz
Download, zMetadata-Versionz2.4)r�parsestr�items�lowerr �join�lstripr�set_payloadr%�replace_header)r.r�parsed_messager)r*�	key_lower�description_linesr+r+r,�convert_pkg_infoBs(
��r<�namecCst�dd|����dd�S)Nz[-_.]+�-�_)�re�subr4�replace)r=r+r+r,�	normalize]srCc@sfeZdZUded<ded<dZded<dZded<dZded	<d
ed<edd
d��Ze	ddd��Z
dS)�
ConvertSourcerr=�versionzpy2.py3�pyver�none�abi�any�platformrrrcCs|j�d|j�d�S)Nr>�
.dist-info)r=rE��selfr+r+r,�
dist_info_diriszConvertSource.dist_info_dir�Iterator[tuple[str, bytes]]cCsdS�Nr+rLr+r+r,�generate_contentsmszConvertSource.generate_contentsN)rr�rrO)�__name__�
__module__�__qualname__�__annotations__rFrHrJ�propertyrNrrQr+r+r+r,rDas
rD)�	metaclassc@s eZdZd
dd�Zddd�Zd	S)�
EggFileSource�pathrcCs�t�|j�}std|j����||_t|�d��|_|�d�|_|�d�}rC|�dd�|_	|�d�}rC|j	�dd	�|_
t|�|_t�|_
dS)
NzInvalid egg file name: r=�verrF�.��arch�py�cp)�egg_filename_re�matchr=�
ValueErrorrZrC�grouprErBrFrHrJrr)rMrZrbrFr^r+r+r,�__init__ss
zEggFileSource.__init__rrOccs��t|jd��\}t|���D]L}|�d�rq|�d�rR|dkr.|�|��d�}t||j	�n#|dkrA|�|��d�}t
||j	�n|dkrQ|j�d�|�|�fVq||�|�fVqWd�dS1sfwYdS)	N�r�/z	EGG-INFO/zEGG-INFO/requires.txt�utf-8zEGG-INFO/PKG-INFOzEGG-INFO/entry_points.txt�/entry_points.txt)r
rZ�sorted�namelistr#r"�read�decoder-rr<rN)rM�zip_file�filenamerr.r+r+r,rQ�s(�


��"�zEggFileSource.generate_contentsN�rZrrR)rSrTrUrerQr+r+r+r,rYrs
rYc@seZdZddd�ZdS)�EggDirectorySourcerrOc
cs��t�|j�D]o\}}}t|�D]e}t||�}|jjdkrh|jdkr.|�d�}t||j	�n9|jdkrW|�d�}t
||j	�|j	�d�}rKt|�|_|j	�d�}	rV|	|_
n|jdkrg|j�d�|��fVqt|�|j��|��fVqqdS)	NzEGG-INFO�requires.txtrh�PKG-INFO�Name�Version�entry_points.txtri)�os�walkrZrjr�parentr=�	read_textr-rr<�getrCrErN�
read_bytesr�relative_to)
rM�dirpathr?�	filenamesrorZrr.r=rEr+r+r,rQ�s0�





�

���z$EggDirectorySource.generate_contentsNrR)rSrTrUrQr+r+r+r,rq�srqc@s$eZdZdZddd�Zddd	�Zd
S)
�WininstFileSourcea�
    Handles distributions created with ``bdist_wininst``.

    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.
    rZrc	Cs:||_t�|_t�|j�}r%t|�d��|_|�d�}r%|�	dd�|_
d}}t|j��e}|��D]O}|�
dd�\}}|set�|�}red}t|�d	��|_|�d
�|_|�d�}rd|�	dd�|_
n|s|t�|�}r|d}|�d�|_|�d�|_|r�|r�n	q3Wd�dSWd�dS1s�wYdS)NrJrFr\r]FrgrTr=r[rH)rZrr�
wininst_re�searchr=rCrdrJrBrFr
rk�split�egg_info_rerbrE�pyd_rerH)	rMrZrbrF�egg_info_found�	pyd_foundrnro�prefixr+r+r,re�s8����"�zWininstFileSource.__init__rrOc
cs6�|j�d|j�d�}|j�d|j�d�}t|jd��v}t|���D]f}|�d�r*q"|�dd�\}}t�	|�ru|�
dd�d}|dkrR|�|��d	�}t
||j�n"|d
kre|�|��d	�}	t|	|j�n|dkrt|�d�|�|�fVq"|d
kr�|�d|��}||�|�fVq"Wd�dS1s�wYdS)Nr>rKz.datarfrgrrrrrhrsrvri�SCRIPTSz	/scripts/)r=rEr
rZrjrkr#r�r�r��rsplitrlrmr-rr<)
rMrN�data_dirrnror��target_filename�basenamerr.r+r+r,rQ�s4�

��"�z#WininstFileSource.generate_contentsNrprR)rSrTrU�__doc__rerQr+r+r+r,r��s
r��files�	list[str]�dest_dir�verbose�boolc
Cs�|D]�}t|�D]�}t|�}|jdkr!|��rt|�}n	t|�}nt|�}|r1t|�d�ddd�t|�|j�d|j	�d|j
�d|j�d|j�d�
}t
|d��x}|��D]
\}	}
|�|	|
�qU|�|j�d	�|jjtd
��d��t�}|�dd
�|�dt�|�dt|jdk����t|j
�d|j�d|j���}t|dd�d�D]
}
|�dt|
��q�|�|j�d�|jtd
��d��Wd�n1s�wY|r�td�qqdS)Nz.eggz...Tr])�flush�endr>z.whl�wz	/METADATA)�policyrhz
Wheel-Versionz1.0�	GeneratorzRoot-Is-PurelibrIcSs|jSrP)�interpreter)�tagr+r+r,�<lambda>Aszconvert.<locals>.<lambda>)r)�Tagz/WHEEL�OK)r
r�suffix�is_dirrqrYr��printr=rErFrHrJrrQ�writestrrNr�	as_string�serialization_policy�encoderr%�	GENERATORrr4rrj)r�r�r��pat�archiverZ�source�	dest_path�	wheelfile�
name_or_zinfo�contents�
wheel_message�tagsr�r+r+r,�convertsZ


 ��
���
������r�)rrrrrr)r.rrr)r=rrr)r�r�r�rr�r�rr)2�
__future__r�os.pathrwr@�abcrr�collectionsr�collections.abcr�
email.messager�email.parserr�email.policyr	�globr
�pathlibr�textwrapr�zipfiler
r]rrr�vendored.packaging.tagsrr�r�compile�VERBOSErar�r�r�r�r�r-r<rCrDrYrqr�r�r+r+r+r,�<module>sV���
�



-^