ok

Mini Shell

Direktori : /opt/alt/python36/lib/python3.6/site-packages/setuptools/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib/python3.6/site-packages/setuptools/__pycache__/wheel.cpython-36.pyc

3

�t^A�@s�dZddlmZddlZddlZddlZddlZddlZddlm	Z	m
Z
mZddlm
Z
ddlm	ZddlmZddlmZejd	ej�jZd
Zdd�ZGd
d�de�ZdS)zWheels support.�)�get_platformN)�Distribution�PathMetadata�
parse_version)�PY3)r)�
pep425tags)�write_requirementsz�^(?P<project_name>.+?)-(?P<version>\d.*?)
    ((-(?P<build>\d.*?))?-(?P<py_version>.+?)-(?P<abi>.+?)-(?P<platform>.+?)
    )\.whl$z�try:
    __import__('pkg_resources').declare_namespace(__name__)
except ImportError:
    __path__ = __import__('pkgutil').extend_path(__path__, __name__)
cCs�x�tj|�D]�\}}}tjj||�}x6|D].}tjj||�}tjj|||�}tj||�q*WxXttt|���D]D\}	}
tjj||
�}tjj|||
�}tjj	|�sntj||�||	=qnWqWx0tj|dd�D]\}}}|s�t
�tj|�q�WdS)zDMove everything under `src_dir` to `dst_dir`, and delete the former.T)�topdownN)�os�walk�path�relpath�join�renames�reversed�list�	enumerate�exists�AssertionError�rmdir)Zsrc_dirZdst_dir�dirpathZdirnames�	filenames�subdir�f�src�dst�n�d�r�	/wheel.py�unpacks

r c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�WheelcCsTttjj|��}|dkr$td|��||_x$|j�j�D]\}}t|||�q8WdS)Nzinvalid wheel name: %r)	�
WHEEL_NAMEr
r�basename�
ValueError�filename�	groupdict�items�setattr)�selfr%�match�k�vrrr�__init__7szWheel.__init__cCs&tj|jjd�|jjd�|jjd��S)z>List tags (py_version, abi, platform) supported by this wheel.�.)�	itertools�product�
py_version�split�abi�platform)r)rrr�tags?s
z
Wheel.tagscs$tj��t�fdd�|j�D�d�S)z5Is the wheel is compatible with the current platform?c3s|]}|�krdVqdS)TNr)�.0�t)�supported_tagsrr�	<genexpr>Hsz&Wheel.is_compatible.<locals>.<genexpr>F)rZ
get_supported�nextr5)r)r)r8r�
is_compatibleEszWheel.is_compatiblecCs*t|j|j|jdkrdnt�d�j�dS)N�any)�project_name�versionr4z.egg)rr=r>r4r�egg_name)r)rrrr?JszWheel.egg_namecstj|j����d|j|jf}d|�d|���fdd�}|d�}|d�}t|jd��}td	�|kovtd
�kns�td|��tj	|��j
|�tjj|���t
j|�t|��d��d
d��ttt��j��������fdd��jD�}tjj|d�}tj�|�tjtjj|d�tjj|d��tt�|d�d�}	t|	jd�dtjj|d��tjj|���tjj�d�}
tjj|
��rtjj|dd�}tj	|�xVtj|
�D]H}|jd��r�tjtjj|
|��n tjtjj|
|�tjj||���q�Wtj|
�x0ttjj�fdd�d$D��D]}
t |
|��q"Wtjj���rNtj��tjj|d �}tjj|��r�t!|��}|j"�j#�}WdQRXxr|D]j}tjj|f|j#d!���}tjj|d"�}tjj|��r�tjj|��r�t!|d#��}|j$t%�WdQRX�q�WWdQRXdS)%z"Install wheel as an egg directory.z%s-%sz%s.dist-infoz%s.datac	sH�jd�|f��,}tr&|j�jd�n|j�}tjj�j|�SQRXdS)Nz%s/%szutf-8)�openr�read�decode�email�parserZParserZparsestr)�name�fp�value)�	dist_info�zfrr�get_metadataVsz*Wheel.install_as_egg.<locals>.get_metadataZWHEELZMETADATAz
Wheel-Versionz1.0z2.0dev0z$unsupported wheel format version: %s)ZmetadatacSsd|_t|�S)N)Zmarker�str)�reqrrr�raw_reqlsz%Wheel.install_as_egg.<locals>.raw_reqc	s6i|].}tt�fdd�t��j|f��D���|�qS)c3s|]}|�kr|VqdS)Nr)r6rL)�install_requiresrrr9rsz2Wheel.install_as_egg.<locals>.<dictcomp>.<genexpr>)r�sorted�map�requires)r6Zextra)�distrNrMrr�
<dictcomp>psz(Wheel.install_as_egg.<locals>.<dictcomp>zEGG-INFOzPKG-INFO)rN�extras_require)Zattrs�egg_infoNzrequires.txt�scriptsz.pycc3s|]}tjj�|�VqdS)N)r
rr)r6r)�	dist_datarrr9�sz'Wheel.install_as_egg.<locals>.<genexpr>�data�headers�purelib�platlibznamespace_packages.txtr.z__init__.py�w)rXrYrZr[)&�zipfileZZipFiler%r=r>r�getr$r
�mkdirZ
extractallrrrZ
from_locationrrrOrPrQZextras�rename�SetuptoolsDistribution�dictrZget_command_objr�listdir�endswith�unlinkr�filterr r@rAr2�write�NAMESPACE_PACKAGE_INIT)r)Zdestination_eggdirZ
dist_basenamerJZwheel_metadataZ
dist_metadataZ
wheel_versionrTrUZ
setup_distZdist_data_scriptsZegg_info_scripts�entryrZnamespace_packagesrF�modZmod_dirZmod_initr)rRrWrHrNrMrIr�install_as_eggPsr 










zWheel.install_as_eggN)�__name__�
__module__�__qualname__r-r5r;r?rkrrrrr!5s
r!)�__doc__Zdistutils.utilrrCr/r
�rer]Z
pkg_resourcesrrrZpkg_resources.extern.sixrZ
setuptoolsrarZsetuptools.command.egg_infor�compile�VERBOSEr*r"rhr �objectr!rrrr�<module>s"


Zerion Mini Shell 1.0