???<!-- GIF89;a -->
123123123123
.....................................................................................................................................???<!-- GIF89;a -->
123123123123
.....................................................................................................................................U
    e5dD                  
   @   s  d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl	Z	d dl
Z
d dlZd dlZd dlZd dlmZ d dlmZ d dlmZ d dlmZ d dlmZ ddd	d
ddddddg
ZG dd	 d	eZG dd deddZG dd dejZG dd dZG dd dZG dd deZ G dd dZ!G dd dZ"G d d! d!e Z#G d"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+dS )+    N)ConfigParser)suppress)import_module)MetaPathFinder)starmapDistributionDistributionFinderPackageNotFoundErrordistributiondistributionsentry_pointsfilesmetadatarequiresversionc                   @   s   e Zd ZdS )r	   N)__name__
__module____qualname__ r   r   */usr/lib64/python3.8/importlib/metadata.pyr	   %   s   c                   @   sR   e Zd ZedZdd Zedd Ze	dd Z
e	dd	 Zd
d Zdd ZdS )
EntryPointzH(?P<module>[\w.]+)\s*(:\s*(?P<attr>[\w.]+)\s*)?((?P<extras>\[.*\])\s*)?$c                 C   sD   | j | j}t|d}td |dp,dd}tt	||S )Nmoduleattr .)
patternmatchvaluer   groupfiltersplit	functoolsreducegetattr)selfr   r   Zattrsr   r   r   loadG   s    zEntryPoint.loadc                 C   s(   | j | j}ttd|dp"dS )Nz\w+extrasr   )r   r   r   listrefinditerr   )r$   r   r   r   r   r&   Q   s    zEntryPoint.extrasc                    s    fdd  D S )Nc                    s,   g | ]$} |D ]\}} |||qqS r   items).0r   namer   clsconfigr   r   
<listcomp>X   s    z+EntryPoint._from_config.<locals>.<listcomp>)sectionsr.   r   r.   r   _from_configV   s    zEntryPoint._from_configc                 C   sN   t dd}t|_z|| W n$ tk
rB   |t| Y nX t	|S )N=)Z
delimiters)
r   strZoptionxformZread_stringAttributeErrorZreadfpioStringIOr   r3   )r/   textr0   r   r   r   
_from_text^   s    
zEntryPoint._from_textc                 C   s   t | j| fS N)iterr-   r$   r   r   r   __iter__j   s    zEntryPoint.__iter__c                 C   s   | j | j| j| jffS r;   )	__class__r-   r   r   r=   r   r   r   
__reduce__p   s    zEntryPoint.__reduce__N)r   r   r   r(   compiler   r%   propertyr&   classmethodr3   r:   r>   r@   r   r   r   r   r   )   s   	



r   ZEntryPointBasezname value groupc                   @   s&   e Zd Zd	ddZdd Zdd ZdS )
PackagePathutf-8c              
   C   s0   |   j|d}| W  5 Q R  S Q R X d S )Nencodinglocateopenread)r$   rG   streamr   r   r   	read_textz   s    zPackagePath.read_textc              
   C   s.   |   d}| W  5 Q R  S Q R X d S )NrbrH   )r$   rL   r   r   r   read_binary~   s    zPackagePath.read_binaryc                 C   s   | j | S r;   )distlocate_filer=   r   r   r   rI      s    zPackagePath.locateN)rE   )r   r   r   rM   rO   rI   r   r   r   r   rD   w   s   
rD   c                   @   s   e Zd Zdd Zdd ZdS )FileHashc                 C   s   | d\| _}| _d S )Nr4   )	partitionmoder   )r$   spec_r   r   r   __init__   s    zFileHash.__init__c                 C   s   d | j| jS )Nz<FileHash mode: {} value: {}>)formatrT   r   r=   r   r   r   __repr__   s    zFileHash.__repr__N)r   r   r   rW   rY   r   r   r   r   rR      s   rR   c                   @   s   e Zd Zejdd Zejdd Zedd Zedd Z	e
d	d
 Ze
dd Zedd Zedd Zedd Zedd Zdd Zdd Zedd Zdd Zdd Zedd  Ze
d!d" Ze
d#d$ Zd%S )&r   c                 C   s   d S r;   r   r$   filenamer   r   r   rM      s    zDistribution.read_textc                 C   s   d S r;   r   r$   pathr   r   r   rQ      s    zDistribution.locate_filec                 C   sD   |   D ].}|tj|d}t|d }|d k	r|  S qt|d S )Nr-   )_discover_resolversr   Contextnextr	   )r/   r-   resolverZdistsrP   r   r   r   	from_name   s    


zDistribution.from_namec                    sJ   | dd   r|rtd p*tjf | tj fdd|  D S )Ncontextz cannot accept context and kwargsc                 3   s   | ]}| V  qd S r;   r   )r,   rb   rd   r   r   	<genexpr>   s   z(Distribution.discover.<locals>.<genexpr>)pop
ValueErrorr   r`   	itertoolschainfrom_iterabler_   )r/   kwargsr   re   r   discover   s    
zDistribution.discoverc                 C   s   t t| S r;   )PathDistributionpathlibPath)r]   r   r   r   at   s    zDistribution.atc                  C   s   dd t jD } td | S )Nc                 s   s   | ]}t |d dV  qdS )find_distributionsN)r#   )r,   finderr   r   r   rf      s   z3Distribution._discover_resolvers.<locals>.<genexpr>)sys	meta_pathr   )Zdeclaredr   r   r   r_      s    z Distribution._discover_resolversc                 C   s(   |  dp|  dp|  d}t|S )NZMETADATAzPKG-INFOr   )rM   emailZmessage_from_stringr$   r9   r   r   r   r      s    
zDistribution.metadatac                 C   s
   | j d S )NZVersion)r   r=   r   r   r   r      s    zDistribution.versionc                 C   s   t | dS )Nzentry_points.txt)r   r:   rM   r=   r   r   r   r      s    zDistribution.entry_pointsc                    s6      p  }d fdd	}|o4tt|t|S )Nc                    s6   t | }|rt|nd |_|r&t|nd |_ |_|S r;   )rD   rR   hashintsizerP   )r-   rx   Zsize_strresultr=   r   r   	make_file   s
    z%Distribution.files.<locals>.make_file)NN)_read_files_distinfo_read_files_egginfor'   r   csvreader)r$   Z
file_linesr|   r   r=   r   r      s    zDistribution.filesc                 C   s   |  d}|o| S )NZRECORD)rM   
splitlinesrw   r   r   r   r}     s    
z!Distribution._read_files_distinfoc                 C   s   |  d}|otdj| S )NzSOURCES.txtz"{}")rM   maprX   r   rw   r   r   r   r~     s    
z Distribution._read_files_egginfoc                 C   s   |   p|  }|ot|S r;   )_read_dist_info_reqs_read_egg_info_reqsr'   )r$   Zreqsr   r   r   r     s    zDistribution.requiresc                 C   s   | j dS )NzRequires-Dist)r   Zget_allr=   r   r   r   r     s    z!Distribution._read_dist_info_reqsc                 C   s   |  d}|o| |S )Nzrequires.txt)rM   _deps_from_requires_text)r$   sourcer   r   r   r      s    
z Distribution._read_egg_info_reqsc                 C   s4   |  | }dd t|tdD }| |S )Nc                 S   s&   i | ]\}}|t ttd |qS )line)r'   r   operator
itemgetter)r,   sectionZresultsr   r   r   
<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_pairsr2   r   r   r   r   $  s
    z%Distribution._deps_from_requires_textc                 c   s<   d }t d | D ](}td|}|r.|d}qt V  qd S )Nz	\[(.*)\]$   )r   r(   r   r   locals)linesr   r   Zsection_matchr   r   r   r   .  s    
zDistribution._read_sectionsc                 #   sB   dd   fdd}|   D ] \}}|D ]}||| V  q(qd S )Nc                 S   s   | odj | dS )Nzextra == "{name}"r^   )rX   r^   r   r   r   make_conditionC  s    zJDistribution._convert_egg_info_reqs_to_simple_reqs.<locals>.make_conditionc                    sX   | pd} |  d\}}}|r,|r,dj|d}ttd | |g}|rTdd| S dS )Nr   :z({markers}))markersz; z and )rS   rX   r'   r   join)r   Zextrasepr   Z
conditionsr   r   r   parse_conditionF  s    zKDistribution._convert_egg_info_reqs_to_simple_reqs.<locals>.parse_conditionr*   )r2   r   r   ZdepsZdepr   r   r   r   8  s
    z2Distribution._convert_egg_info_reqs_to_simple_reqsN)r   r   r   abcabstractmethodrM   rQ   rC   rc   rm   staticmethodrq   r_   rB   r   r   r   r   r}   r~   r   r   r   r   r   r   r   r   r   r   r      s@   











	
	c                   @   s.   e Zd ZG dd dZeje fddZdS )r   c                   @   s$   e Zd ZdZdd Zedd ZdS )zDistributionFinder.ContextNc                 K   s   t | | d S r;   )varsupdate)r$   rl   r   r   r   rW   j  s    z#DistributionFinder.Context.__init__c                 C   s   t | dtjS )Nr]   )r   getrt   r]   r=   r   r   r   r]   m  s    zDistributionFinder.Context.path)r   r   r   r-   rW   rB   r]   r   r   r   r   r`   X  s   r`   c                 C   s   d S r;   r   )r$   rd   r   r   r   rr   w  s    z%DistributionFinder.find_distributionsN)r   r   r   r`   r   r   rr   r   r   r   r   r   S  s   c                   @   s<   e Zd Zdd Zdd Zdd Zdd Zd	d
 Zdd ZdS )FastPathc                 C   s   || _ tj| | _d S r;   )rootosr]   basenamelowerbase)r$   r   r   r   r   rW     s    zFastPath.__init__c                 C   s   t | j|S r;   )ro   rp   r   )r$   childr   r   r   joinpath  s    zFastPath.joinpathc              
   C   sT   t t t| jpdW  5 Q R  S Q R X t t |  W  5 Q R  S Q R X g S )Nr   )r   	Exceptionr   listdirr   zip_childrenr=   r   r   r   children  s
    
"
zFastPath.childrenc                 C   s2   t | j}|j }|j| _tdd |D S )Nc                 s   s    | ]}| tjd d V  qdS )r   r   N)r    	posixpathr   )r,   r   r   r   r   rf     s   z(FastPath.zip_children.<locals>.<genexpr>)zipfilerp   r   Znamelistr   dictfromkeys)r$   Zzip_pathnamesr   r   r   r     s    

zFastPath.zip_childrenc                 C   s&   | j }||jkp$||jo$|dS )N.egg)r   versionless_egg_name
startswithprefixendswith)r$   searchr   r   r   r   is_egg  s
    
zFastPath.is_eggc                 c   sZ   |   D ]L}| }||jksH||jr6||jsH| |r|dkr| |V  qd S )Nzegg-info)	r   r   exact_matchesr   r   r   suffixesr   r   )r$   r-   r   Zn_lowr   r   r   r     s    


zFastPath.searchN)	r   r   r   rW   r   r   r   r   r   r   r   r   r   r     s   
r   c                   @   s2   e Zd ZdZdZdZdgdd ZdZdd ZdS )Preparedr   )z
.dist-infoz	.egg-infoNr   c                    sV   | _ |d krd S | dd _ jd  _ fdd jD  _ jd  _d S )N-rV   c                    s   g | ]} j | qS r   )
normalized)r,   suffixr=   r   r   r1     s    z%Prepared.__init__.<locals>.<listcomp>r   )r-   r   replacer   r   r   r   r   )r$   r-   r   r=   r   rW     s    
zPrepared.__init__)	r   r   r   r   r   r   r   r   rW   r   r   r   r   r     s   r   c                   @   s,   e Zd Zee fddZedd ZdS )MetadataPathFinderc                 C   s   |  |j|j}tt|S r;   )_search_pathsr-   r]   r   rn   )r/   rd   foundr   r   r   rr     s    
z%MetadataPathFinder.find_distributionsc                    s    t j fddtt|D S )Nc                 3   s   | ]}| t V  qd S r;   )r   r   )r,   r]   r^   r   r   rf     s   z3MetadataPathFinder._search_paths.<locals>.<genexpr>)ri   rj   rk   r   r   )r/   r-   pathsr   r^   r   r     s    z MetadataPathFinder._search_pathsN)r   r   r   rC   r   r`   rr   r   r   r   r   r   r     s   r   c                   @   s.   e Zd Zdd Zdd Zejje_dd ZdS )rn   c                 C   s
   || _ d S r;   )_pathr\   r   r   r   rW     s    zPathDistribution.__init__c              
   C   s<   t ttttt" | j|jddW  5 Q R  S Q R X d S )NrE   rF   )	r   FileNotFoundErrorIsADirectoryErrorKeyErrorNotADirectoryErrorPermissionErrorr   r   rM   rZ   r   r   r   rM     s
     zPathDistribution.read_textc                 C   s   | j j| S r;   )r   parentr\   r   r   r   rQ     s    zPathDistribution.locate_fileN)r   r   r   rW   rM   r   __doc__rQ   r   r   r   r   rn     s   
rn   c                 C   s
   t | S r;   )r   rc   Zdistribution_namer   r   r   r
     s    c                  K   s   t jf | S r;   )r   rm   )rl   r   r   r   r     s    c                 C   s   t | jS r;   )r   rc   r   r   r   r   r   r     s    c                 C   s
   t | jS r;   )r
   r   r   r   r   r   r     s    c                  C   sH   t jdd t D } td}t| |d}t ||}dd |D S )Nc                 s   s   | ]}|j V  qd S r;   )r   )r,   rP   r   r   r   rf     s    zentry_points.<locals>.<genexpr>r   )keyc                 S   s   i | ]\}}|t |qS r   )tuple)r,   r   epsr   r   r   r     s    z entry_points.<locals>.<dictcomp>)ri   rj   rk   r   r   
attrgettersortedr   )r   Zby_groupZorderedZgroupedr   r   r   r     s    
c                 C   s
   t | jS r;   )r
   r   r   r   r   r   r   %  s    c                 C   s
   t | jS r;   )r
   r   r   r   r   r   r   .  s    ),r7   r   r(   r   r   rt   rv   ro   r   r   r!   ri   r   collectionsZconfigparserr   
contextlibr   	importlibr   importlib.abcr   r   __all__ModuleNotFoundErrorr	   
namedtupler   ZPurePosixPathrD   rR   r   r   r   r   r   rn   r
   r   r   r   r   r   r   r   r   r   r   <module>   sb   

N E/0		
	