[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@18.226.159.94: ~ $


�t�_�/�@s�dZddlZddlZddlZddlZddlmZmZddlm	Z	ddl
mZddlm
Z
ddlmZddlmZmZdd	lmZdd
lmZerddlmZmZmZmZmZddlmZdd
lmZej e!�Z"dd�Z#Gdd�de$�Z%Gdd�de%�Z&Gdd�de&�Z'Gdd�de$�Z(Gdd�de%�Z)dS)zCache Management
�N)�interpreter_name�interpreter_version)�canonicalize_name)�InvalidWheelFilename)�Link)�Wheel)�
TempDirectory�
tempdir_kinds)�MYPY_CHECK_RUNNING)�path_to_url)�Optional�Set�List�Any�Dict)�Tag)�
FormatControlcCs=tj|dddddd�}tj|jd��j�S)	z'Return a stable sha224 of a dictionary.�	sort_keysT�
separators�,�:�ensure_ascii�ascii)rr)�json�dumps�hashlib�sha224�encode�	hexdigest)�d�s�r!��/builddir/build/BUILDROOT/alt-python35-pip-20.2.4-1.el7.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/cache.py�
_hash_dicts!r#cspeZdZdZ�fdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
�S)�Cachea�An abstract class - provides cache directories for data from links


        :param cache_dir: The root of the cache.
        :param format_control: An object of FormatControl class to limit
            binaries being read from the cache.
        :param allowed_formats: which formats of files the cache should store.
            ('binary' and 'source' are the only allowed values)
    cs�tt|�j�|s2tjj|�s2t�|p;d|_||_||_	ddh}|j	j
|�|ks}t�dS)N�source�binary)�superr$�__init__�os�path�isabs�AssertionError�	cache_dir�format_control�allowed_formats�union)�selfr-r.r/�_valid_formats)�	__class__r!r"r(/s		zCache.__init__cCs�|jg}|jdk	rL|jdk	rL|jdj|j|jg��dj|�}tj|j��j�}|dd�|dd�|dd�|dd�g}|S)z�Get parts of part that must be os.path.joined with cache_dir

        Legacy cache key (pip < 20) for compatibility with older caches.
        N�=�#���)	�url_without_fragment�	hash_name�hash�append�joinrrrr)r1�link�	key_parts�key_url�hashed�partsr!r!r"�_get_cache_path_parts_legacy:s
":z"Cache._get_cache_path_parts_legacycCs�d|ji}|jdk	r=|jdk	r=|j||j<|jrS|j|d<t�|d<t�|d<t|�}|dd�|dd�|dd�|dd�g}|S)	zEGet parts of part that must be os.path.joined with cache_dir
        �urlN�subdirectoryrrr6r7r8)r9r:r;�subdirectory_fragmentrrr#)r1r>r?rArBr!r!r"�_get_cache_path_partsVs	


:zCache._get_cache_path_partsc	Cs�|jp|p|}|r"gS|jj|�}|jj|�sJgSg}|j|�}tjj|�r�x*tj	|�D]}|j
||f�q�W|j|�}tjj|�r�x*tj	|�D]}|j
||f�q�W|S)N)r-r.�get_allowed_formatsr/�intersection�get_path_for_linkr)r*�isdir�listdirr<�get_path_for_link_legacy)	r1r>�canonical_package_name�
can_not_cache�formats�
candidatesr*�	candidate�legacy_pathr!r!r"�_get_candidatesys&
		zCache._get_candidatescCs
t��dS)N)�NotImplementedError)r1r>r!r!r"rM�szCache.get_path_for_link_legacycCs
t��dS)z>Return a directory to store cached items in for link.
        N)rU)r1r>r!r!r"rJ�szCache.get_path_for_linkcCs
t��dS)zaReturns a link to a cached item if it exists, otherwise returns the
        passed link.
        N)rU)r1r>�package_name�supported_tagsr!r!r"�get�s
z	Cache.get)�__name__�
__module__�__qualname__�__doc__r(rCrGrTrMrJrXr!r!)r3r"r$$s	#r$csLeZdZdZ�fdd�Zdd�Zdd�Zdd	�Z�S)
�SimpleWheelCachez+A cache of wheels for future installs.
    cs#tt|�j||dh�dS)Nr&)r'r]r()r1r-r.)r3r!r"r(�szSimpleWheelCache.__init__cCs7|j|�}|jst�tjj|jd|�S)N�wheels)rCr-r,r)r*r=)r1r>rBr!r!r"rM�sz)SimpleWheelCache.get_path_for_link_legacycCs7|j|�}|jst�tjj|jd|�S)a�Return a directory to store cached wheels for link

        Because there are M wheels for any one sdist, we provide a directory
        to cache them in, and then consult that directory when looking up
        cache hits.

        We only insert things into the cache if they have plausible version
        numbers, so that we don't contaminate the cache with things that were
        not unique. E.g. ./package might have dozens of installs done for it
        and build a version of 0.0...and if we built and cached a wheel, we'd
        end up using the same wheel even if the source has been edited.

        :param link: The link of the sdist for which this will cache wheels.
        r^)rGr-r,r)r*r=)r1r>rBr!r!r"rJ�sz"SimpleWheelCache.get_path_for_linkc
Csg}|s|St|�}x�|j||�D]�\}}yt|�}Wntk
rbw/YnXt|j�|kr�tjd|||�q/|j|�s�q/|j|j	|�||f�q/W|s�|St
|�\}	}}ttt
jj||���S)NzWIgnoring cached wheel %s for %s as it does not match the expected distribution name %s.)rrTrr�name�logger�debug�	supportedr<�support_index_min�minrrr)r*r=)
r1r>rVrWrQrN�
wheel_name�	wheel_dir�wheel�_r!r!r"rX�s2	

zSimpleWheelCache.get)rYrZr[r\r(rMrJrXr!r!)r3r"r]�s
r]cs(eZdZdZ�fdd�Z�S)�EphemWheelCachezGA SimpleWheelCache that creates it's own temporary cache directory
    cs>tdtjdd�|_tt|�j|jj|�dS)N�kind�globally_managedT)rr	�EPHEM_WHEEL_CACHE�	_temp_dirr'rir(r*)r1r.)r3r!r"r(s
	zEphemWheelCache.__init__)rYrZr[r\r(r!r!)r3r"ri�sric@seZdZdd�ZdS)�
CacheEntrycCs||_||_dS)N)r>�
persistent)r1r>ror!r!r"r(s	zCacheEntry.__init__N)rYrZr[r(r!r!r!r"rnsrncsdeZdZdZ�fdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	�S)�
WheelCachez�Wraps EphemWheelCache and SimpleWheelCache into a single Cache

    This Cache allows for gracefully degradation, using the ephem wheel cache
    when a certain link is not found in the simple wheel cache first.
    csDtt|�j||dh�t||�|_t|�|_dS)Nr&)r'rpr(r]�_wheel_cacheri�_ephem_cache)r1r-r.)r3r!r"r(szWheelCache.__init__cCs|jj|�S)N)rqrM)r1r>r!r!r"rM'sz#WheelCache.get_path_for_link_legacycCs|jj|�S)N)rqrJ)r1r>r!r!r"rJ+szWheelCache.get_path_for_linkcCs|jj|�S)N)rrrJ)r1r>r!r!r"�get_ephem_path_for_link/sz"WheelCache.get_ephem_path_for_linkcCs,|j|||�}|dkr%|S|jS)N)�get_cache_entryr>)r1r>rVrW�cache_entryr!r!r"rX3szWheelCache.getcCs~|jjd|d|d|�}||k	r=t|dd�S|jjd|d|d|�}||k	rzt|dd�SdS)z�Returns a CacheEntry with a link to a cached item if it exists or
        None. The cache entry indicates if the item was found in the persistent
        or ephemeral cache.
        r>rVrWroTFN)rqrXrnrr)r1r>rVrW�retvalr!r!r"rt?s		zWheelCache.get_cache_entry)
rYrZr[r\r(rMrJrsrXrtr!r!)r3r"rpsrp)*r\rr�loggingr)�pip._vendor.packaging.tagsrrZpip._vendor.packaging.utilsr�pip._internal.exceptionsr�pip._internal.models.linkr�pip._internal.models.wheelr�pip._internal.utils.temp_dirrr	�pip._internal.utils.typingr
�pip._internal.utils.urlsr�typingrr
rrrr�#pip._internal.models.format_controlr�	getLoggerrYr`r#�objectr$r]rirnrpr!r!r!r"�<module>s.(�R

Filemanager

Name Type Size Permission Actions
__init__.cpython-35.pyc File 781 B 0644
build_env.cpython-35.pyc File 7.92 KB 0644
cache.cpython-35.pyc File 9.52 KB 0644
configuration.cpython-35.pyc File 11.39 KB 0644
exceptions.cpython-35.pyc File 15.22 KB 0644
locations.cpython-35.pyc File 4.77 KB 0644
main.cpython-35.pyc File 698 B 0644
pyproject.cpython-35.pyc File 3.93 KB 0644
self_outdated_check.cpython-35.pyc File 4.81 KB 0644
wheel_builder.cpython-35.pyc File 7.18 KB 0644