Your IP : 18.188.0.20


Current Path : /opt/alt/python36/lib64/python3.6/ensurepip/rewheel/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/ensurepip/rewheel/__pycache__/__init__.cpython-36.opt-2.pyc

3

 fL�@s�ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZdd�Zdd�Z
dd�Zdd	�Zd
d�ZdS)�NcCs�tjdd�}|jddd�|jdddd	tjjd
�|j�}d}yttft	|���Wn4t
k
r�}ztdj|��d
}WYdd}~XnXtj
d
�dS)Nz,Recreate wheel of package with given RECORD.)�description�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/python36/lib64/python3.6/__init__.py�run
srcs�g}tjtjtjg�}dd�|D�}x�|D]�}d}xd|D]\�tjj�|�djtj	���fdd�tj
��D�}�fdd�|D�}t|�dkr8|d}q8W|dk	r�|jtjj|d��q*|jd�q*W|S)	NcSsg|]}tjj|�r|�qSr)rr
�exists)�.0�sprrr�
<listcomp>(sz'find_system_records.<locals>.<listcomp>z-[^\{0}]+\.dist-infocsg|]}tjj�|��qSr)rr
�join)r�p)rrrr .scsg|]}tj�|�r|�qSr)�re�match)r�c)�dist_info_rerrr 0srrZRECORD)
�site�getsitepackagesr�base_prefix�base_exec_prefixrr
r!r�sep�listdir�len�append)ZprojectsZrecordsZsys_sitepackZprojectr
Z
candidatesZfilteredr)r&rr�find_system_recordss

r/cCs�tjjtjj|��}|t|�d�jtjj�}t||�\}}t|�}tjj||d�}t	j
|dt	jd�}tj
�}	tj|	�}
x:|D]2\}}}
|jtjj||�|d�|
j|||
g�q�W|
j|ddg�|j||	j��|j�|jS)Nz.whl�w)�modeZcompression)Zarcname�)rr
�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
rcCstjjtjj|�d�}tj|dd��}tjj�j	|j
��}WdQRXtjjtjj|�d�}tj|dd��}tjj�j	|j
��}WdQRX|jd�}|jd�}d}	g}
x&|jd�D]}|
j
|jd	�d
�q�Wdj|
�}
|jd�jd	�dd
�\}}
td|||	|
||
g�}d	jt|��S)NZWHEELzutf-8)�encodingZMETADATA�NameZVersionr2ZTag�-r�.r�)rr
r!r3�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_joinrrrr6Vs 


r6c
Cstjj||�}tj|dd��}|j�}WdQRXtjj|�jtjj�}|dt	d��d}g}g}x�|j
�D]�}|jd�}	t	|	�dkrntjj|	d�s�|	dj
d�s�|	djd	�s�|	djd
�s�|	d|ks�|	dj
|�r�|j|	�q�|j|	�qnqnW||fS)Nzutf-8)rFz	dist-info�data�,rJrz..z.pycz.pyo)rr
r!rKrLrNr3r4r+r-�
splitlinesrP�isabs�
startswith�endswithr.)
r@rAZrecord_file_pathZrecord_fileZrecord_contentsZdata_dirrBrC�lZsplrrrr5ns"
r5)r	rKr:Zemail.parserrMrr8r#r'�
subprocessrr7rr/rr6r5rrrr�<module>s

?>