Your IP : 3.144.30.14


Current Path : /opt/alt/python38/lib64/python3.8/importlib/__pycache__/
Upload File :
Current File : //opt/alt/python38/lib64/python3.8/importlib/__pycache__/metadata.cpython-38.opt-2.pyc

U

i�f�D�
@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlmZddlmZddlmZddlmZddlmZddd	d
ddd
dddg
ZGdd	�d	e�ZGdd�de
�dd��ZGdd�dej�ZGdd�d�ZGdd�d�ZGdd�de�Z Gdd�d�Z!Gdd�d�Z"Gd d!�d!e �Z#Gd"d#�d#e�Z$d$d
�Z%d%d�Z&d&d�Z'd'd�Z(d(d�Z)d)d
�Z*d*d�Z+dS)+�N)�ConfigParser)�suppress)�
import_module)�MetaPathFinder)�starmap�Distribution�DistributionFinder�PackageNotFoundError�distribution�
distributions�entry_points�files�metadata�requires�versionc@seZdZdS)r	N)�__name__�
__module__�__qualname__�rr�7/opt/alt/python38/lib64/python3.8/importlib/metadata.pyr	%sc@sReZdZe�d�Zdd�Zedd��Ze	dd��Z
e	dd	��Zd
d�Zdd
�Z
dS)�
EntryPointzH(?P<module>[\w.]+)\s*(:\s*(?P<attr>[\w.]+)\s*)?((?P<extras>\[.*\])\s*)?$cCsD|j�|j�}t|�d��}td|�d�p,d�d��}t�t	||�S)N�module�attr��.)
�pattern�match�valuer�group�filter�split�	functools�reduce�getattr)�selfrrZattrsrrr�loadGszEntryPoint.loadcCs(|j�|j�}tt�d|�d�p"d��S)Nz\w+�extrasr)rrr�list�re�finditerr)r$rrrrr&QszEntryPoint.extrascs��fdd����D�S)Ncs,g|]$}��|�D]\}}�|||��qqSr��items)�.0r�namer��cls�configrr�
<listcomp>Xs�z+EntryPoint._from_config.<locals>.<listcomp>)�sectionsr.rr.r�_from_configVs�zEntryPoint._from_configcCsNtdd�}t|_z|�|�Wn$tk
rB|�t�|��YnXt�	|�S)N�=)Z
delimiters)
r�strZoptionxformZread_string�AttributeErrorZreadfp�io�StringIOrr3)r/�textr0rrr�
_from_text^s
zEntryPoint._from_textcCst|j|f�S�N)�iterr-�r$rrr�__iter__jszEntryPoint.__iter__cCs|j|j|j|jffSr;)�	__class__r-rrr=rrr�
__reduce__ps�zEntryPoint.__reduce__N)rrrr(�compilerr%�propertyr&�classmethodr3r:r>r@rrrrr)s	�



rZEntryPointBasezname value groupc@s&eZdZd	dd�Zdd�Zdd�ZdS)
�PackagePath�utf-8c
Cs0|��j|d��}|��W5QR�SQRXdS)N��encoding��locate�open�read)r$rG�streamrrr�	read_textzszPackagePath.read_textc
Cs.|���d��}|��W5QR�SQRXdS)N�rbrH)r$rLrrr�read_binary~szPackagePath.read_binarycCs|j�|�Sr;)�dist�locate_filer=rrrrI�szPackagePath.locateN)rE)rrrrMrOrIrrrrrDws
rDc@seZdZdd�Zdd�ZdS)�FileHashcCs|�d�\|_}|_dS)Nr4)�	partition�moder)r$�spec�_rrr�__init__�szFileHash.__init__cCsd�|j|j�S)Nz<FileHash mode: {} value: {}>)�formatrTrr=rrr�__repr__�szFileHash.__repr__N)rrrrWrYrrrrrR�srRc@s�eZdZejdd��Zejdd��Zedd��Zedd��Z	e
d	d
��Ze
dd��Ze
d
d��Ze
dd��Ze
dd��Ze
dd��Zdd�Zdd�Ze
dd��Zdd�Zdd�Zedd ��Ze
d!d"��Ze
d#d$��Zd%S)&rcCsdSr;r�r$�filenamerrrrM�szDistribution.read_textcCsdSr;r�r$�pathrrrrQ�szDistribution.locate_filecCsD|��D].}|tj|d��}t|d�}|dk	r|Sqt|��dS)N�r-)�_discover_resolversr�Context�nextr	)r/r-�resolverZdistsrPrrr�	from_name�s


zDistribution.from_namecsJ|�dd���r|rtd���p*tjf|��tj��fdd�|��D��S)N�contextz cannot accept context and kwargsc3s|]}|��VqdSr;r)r,rb�rdrr�	<genexpr>�s�z(Distribution.discover.<locals>.<genexpr>)�pop�
ValueErrorrr`�	itertools�chain�
from_iterabler_)r/�kwargsrrer�discover�s
�zDistribution.discovercCstt�|��Sr;)�PathDistribution�pathlib�Path)r]rrr�at�szDistribution.atcCsdd�tjD�}td|�S)Ncss|]}t|dd�VqdS)�find_distributionsN)r#)r,�finderrrrrf�s�z3Distribution._discover_resolvers.<locals>.<genexpr>)�sys�	meta_pathr)Zdeclaredrrrr_�s�z Distribution._discover_resolverscCs(|�d�p|�d�p|�d�}t�|�S)NZMETADATAzPKG-INFOr)rM�emailZmessage_from_string�r$r9rrrr�s
��zDistribution.metadatacCs
|jdS)NZVersion)rr=rrrr�szDistribution.versioncCst�|�d��S)Nzentry_points.txt)rr:rMr=rrrr�szDistribution.entry_pointscs6���p���}d�fdd�	}|o4tt|t�|���S)Ncs6t|�}|rt|�nd|_|r&t|�nd|_�|_|Sr;)rDrR�hash�int�sizerP)r-rxZsize_str�resultr=rr�	make_file�s
z%Distribution.files.<locals>.make_file)NN)�_read_files_distinfo�_read_files_egginfor'r�csv�reader)r$Z
file_linesr|rr=rr
�szDistribution.filescCs|�d�}|o|��S)NZRECORD)rM�
splitlinesrwrrrr}s
z!Distribution._read_files_distinfocCs|�d�}|otdj|���S)NzSOURCES.txtz"{}")rM�maprXr�rwrrrr~s
z Distribution._read_files_egginfocCs|��p|��}|ot|�Sr;)�_read_dist_info_reqs�_read_egg_info_reqsr')r$ZreqsrrrrszDistribution.requirescCs|j�d�S)Nz
Requires-Dist)rZget_allr=rrrr�sz!Distribution._read_dist_info_reqscCs|�d�}|o|�|�S)Nzrequires.txt)rM�_deps_from_requires_text)r$�sourcerrrr� s
z Distribution._read_egg_info_reqscCs4|�|���}dd�t�|t�d��D�}|�|�S)NcSs&i|]\}}|ttt�d�|���qS)�line)r'r��operator�
itemgetter)r,�sectionZresultsrrr�
<dictcomp>'s�z9Distribution._deps_from_requires_text.<locals>.<dictcomp>r�)�_read_sectionsr�ri�groupbyr�r��%_convert_egg_info_reqs_to_simple_reqs)r/r�Z
section_pairsr2rrrr�$s
�z%Distribution._deps_from_requires_textccs<d}td|�D](}t�d|�}|r.|�d�}qt�VqdS)Nz	\[(.*)\]$�)rr(rr�locals)�linesr�r�Z
section_matchrrrr�.s
zDistribution._read_sectionsc#sBdd���fdd�}|��D] \}}|D]}|||�Vq(qdS)NcSs|odj|d�S)Nzextra == "{name}"r^)rXr^rrr�make_conditionCszJDistribution._convert_egg_info_reqs_to_simple_reqs.<locals>.make_conditioncsX|pd}|�d�\}}}|r,|r,dj|d�}ttd|�|�g��}|rTdd�|�SdS)Nr�:z({markers}))�markersz; z and )rSrXr'r�join)r�Zextra�sepr�Z
conditions�r�rr�parse_conditionFszKDistribution._convert_egg_info_reqs_to_simple_reqs.<locals>.parse_conditionr*)r2r�r�ZdepsZdeprr�rr�8s
z2Distribution._convert_egg_info_reqs_to_simple_reqsN)rrr�abc�abstractmethodrMrQrCrcrm�staticmethodrqr_rBrrrr
r}r~rr�r�r�r�r�rrrrr�s@











	
	c@s.eZdZGdd�d�Zeje�fdd��ZdS)rc@s$eZdZdZdd�Zedd��ZdS)zDistributionFinder.ContextNcKst|��|�dSr;)�vars�update)r$rlrrrrWjsz#DistributionFinder.Context.__init__cCst|��dtj�S)Nr])r��getrtr]r=rrrr]mszDistributionFinder.Context.path)rrrr-rWrBr]rrrrr`Xsr`cCsdSr;r)r$rdrrrrrwsz%DistributionFinder.find_distributionsN)rrrr`r�r�rrrrrrrSsc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�FastPathcCs||_tj�|���|_dSr;)�root�osr]�basename�lower�base)r$r�rrrrW�szFastPath.__init__cCst�|j|�Sr;)rorpr�)r$�childrrr�joinpath�szFastPath.joinpathc
CsTtt��t�|jpd�W5QR�SQRXtt��|��W5QR�SQRXgS)Nr)r�	Exceptionr��listdirr��zip_childrenr=rrr�children�s

"
zFastPath.childrencCs2t�|j�}|j��}|j|_t�dd�|D��S)Ncss |]}|�tjd�dVqdS)r�rN)r �	posixpathr�)r,r�rrrrf�s�z(FastPath.zip_children.<locals>.<genexpr>)�zipfilerpr�Znamelistr��dict�fromkeys)r$Zzip_path�namesrrrr��s

�zFastPath.zip_childrencCs&|j}||jkp$|�|j�o$|�d�S)N�.egg)r��versionless_egg_name�
startswith�prefix�endswith)r$�searchr�rrr�is_egg�s

�zFastPath.is_eggccsZ|��D]L}|��}||jksH|�|j�r6|�|j�sH|�|�r|dkr|�|�VqdS)Nzegg-info)	r�r��
exact_matchesr�r�r��suffixesr�r�)r$r-r�Zn_lowrrrr��s

�
���zFastPath.searchN)	rrrrWr�r�r�r�r�rrrrr��s
r�c@s2eZdZdZdZdZdgdd�ZdZdd�ZdS)�Preparedr)z
.dist-infoz	.egg-infoNrcsV|�_|dkrdS|���dd��_�jd�_�fdd��jD��_�jd�_dS)N�-rVcsg|]}�j|�qSr)�
normalized)r,�suffixr=rrr1�sz%Prepared.__init__.<locals>.<listcomp>r�)r-r��replacer�r�r�r�r�)r$r-rr=rrW�s
�zPrepared.__init__)	rrrr�r�r�r�r�rWrrrrr��sr�c@s,eZdZee��fdd��Zedd��ZdS)�MetadataPathFindercCs|�|j|j�}tt|�Sr;)�
_search_pathsr-r]r�rn)r/rd�foundrrrrr�s
z%MetadataPathFinder.find_distributionscs tj��fdd�tt|�D��S)Nc3s|]}|�t���VqdSr;)r�r�)r,r]r^rrrf�s�z3MetadataPathFinder._search_paths.<locals>.<genexpr>)rirjrkr�r�)r/r-�pathsrr^rr��s�z MetadataPathFinder._search_pathsN)rrrrCrr`rrr�rrrrr��sr�c@s.eZdZdd�Zdd�Zejje_dd�ZdS)rncCs
||_dSr;)�_pathr\rrrrW�szPathDistribution.__init__c
Cs<tttttt��"|j�|�jdd�W5QR�SQRXdS)NrErF)	r�FileNotFoundError�IsADirectoryError�KeyError�NotADirectoryError�PermissionErrorr�r�rMrZrrrrM�s
�zPathDistribution.read_textcCs|jj|Sr;)r��parentr\rrrrQ�szPathDistribution.locate_fileN)rrrrWrMr�__doc__rQrrrrrn�s
rncCs
t�|�Sr;)rrc�Zdistribution_namerrrr
�scKstjf|�Sr;)rrm)rlrrrr�scCst�|�jSr;)rrcrr�rrrrscCs
t|�jSr;)r
rr�rrrrscCsHtj�dd�t�D��}t�d�}t||d�}t�||�}dd�|D�S)Ncss|]}|jVqdSr;)r)r,rPrrrrfszentry_points.<locals>.<genexpr>r)�keycSsi|]\}}|t|��qSr)�tuple)r,r�epsrrrr�s�z entry_points.<locals>.<dictcomp>)rirjrkrr��
attrgetter�sortedr�)r�Zby_groupZorderedZgroupedrrrrs�
�cCs
t|�jSr;)r
r
r�rrrr
%scCs
t|�jSr;)r
rr�rrrr.s),r7r�r(r�rrtrvror�r�r!rir��collectionsZconfigparserr�
contextlibr�	importlibr�
importlib.abcrr�__all__�ModuleNotFoundErrorr	�
namedtuplerZ
PurePosixPathrDrRrrr�r�r�rnr
rrrrr
rrrrr�<module>sb�

�NE/0		
	

?>