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: //lib/python3/dist-packages/wheel/__pycache__/metadata.cpython-38.pyc
U

�-^��@sndZddlZddlZddlZddlZddlmZe�d�Z	dd�Z
dd	�Zd
d�Zdd
�Z
dd�Zdd�ZdS)z2
Tools for converting old- to new-style metadata.
�N�)�
read_pkg_infozF^(?P<package>.*?)(;\s*(?P<condition>.*?)(extra == '(?P<extra>.*?)')?)$cCsRt|dd�rd|jSg}|jD]\}}|�||�q |s@dSdd�t|��S)zFReturn the version specifier for a requirement in PEP 345/566 fashion.�urlNz @ �z (%s)�,)�getattrrZspecs�append�join�sorted)ZrequirementZ
requires_dist�opZver�r�0/usr/lib/python3/dist-packages/wheel/metadata.py�requires_to_requires_dists
rccsN|D]D}tj�|�}t|�}d�t|j��}|r8d|}|j||VqdS)z=Yield Requires-Dist: strings for parsed requirements strings.rz[%s]N)�
pkg_resourcesZRequirement�parserr	r
�extrasZproject_name)ZrequirementsZreqZparsed_requirement�specrrrr
�convert_requirementssrccs�|��D]�\}}d}|pd}d|kr4|�dd�\}}t�|�}|rhd|fV|r\d|d}|d|7}|rtd|}t|�D]}d	||fVq|qd
S)a,
    Convert requirements from a setup()-style dictionary to ('Requires-Dist', 'requirement')
    and ('Provides-Extra', 'extra') tuples.

    extras_require is a dictionary of {extra: [requirements]} as passed to setup(),
    using the empty extra {'': [requirements]} to hold install_requires.
    r�:r�Provides-Extra�(z) and z
extra == '%s'z ; �
Requires-DistN)�items�splitrZ
safe_extrar)Zextras_require�extraZdependsZ	conditionZnew_reqrrr
�generate_requirements*s

rc	Cs�t|�}|�dd�|d=|d=tj�|d�}tj�|�r�t|��}|��}W5QRXtt	�
|�dd�d�}|D]6\}}t||i�D] \}	}
|	|
f|��kr�|
||	<q�qp|d	}|r�|�
t|��|d	=|S)
zN
    Convert .egg-info directory with PKG-INFO to the Metadata 2.1 format
    zMetadata-Versionz2.1rrzrequires.txtcSs|dp
dS)Nrrr)�xrrr
�<lambda>U�z%pkginfo_to_metadata.<locals>.<lambda>)�key�Description)rZreplace_header�os�pathr	�exists�open�readr
rZsplit_sectionsrrZset_payload�dedent_description)Z
egg_info_pathZpkginfo_path�pkg_infoZ
requires_pathZ
requires_fileZrequiresZparsed_requirementsrZreqsr�value�descriptionrrr
�pkginfo_to_metadataFs(

�r*cCsV||}|��}t|t�sR|��D].}|d��|kr"|d�dd��d�}qRq"|S)z<Hack to coax Unicode out of an email Message() - Python 3.3+rr�ascii�surrogateescapezutf-8)�lower�
isinstance�strZ	raw_items�encode�decode)r'Zfield�text�itemrrr
�pkginfo_unicodecs
�r4c
Csr|d}d}t|t�s$d}t|d�}|��}d�|d��t�d�|dd���df�}|rn|�d��	d	d
�}|S)z@
    Dedent and convert pkg_info['Description'] to Unicode.
    r FT�
rrN�utf8r+r,)
r.r/r4�
splitlinesr	�lstrip�textwrap�dedentr0r1)r'r)Z
surrogatesZdescription_linesZdescription_dedentrrr
r&qs(


����r&)�__doc__�os.pathr!�rer9rZpkginfor�compileZEXTRA_RErrrr*r4r&rrrr
�<module>s�