ok

Mini Shell

Direktori : /opt/alt/python36/lib/python3.6/site-packages/pip/_internal/
Upload File :
Current File : //opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyc

�
Bu�_c@s�dZddlZddlZddlZddlZddlmZmZddlm	Z	ddl
mZddlm
Z
ddlmZddlmZmZdd	lmZdd
lmZerddlmZmZmZmZmZddlmZdd
lmZnej e!�Z"d�Z#de$fd��YZ%de%fd��YZ&de&fd��YZ'de$fd��YZ(de%fd��YZ)dS(sCache Management
i����N(tinterpreter_nametinterpreter_version(tcanonicalize_name(tInvalidWheelFilename(tLink(tWheel(t
TempDirectoryt
tempdir_kinds(tMYPY_CHECK_RUNNING(tpath_to_url(tOptionaltSettListtAnytDict(tTag(t
FormatControlcCs=tj|dtdddt�}tj|jd��j�S(s'Return a stable sha224 of a dictionary.t	sort_keyst
separatorst,t:tensure_asciitascii(RR(tjsontdumpstTruethashlibtsha224tencodet	hexdigest(tdts((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyt
_hash_dicts!tCachecBsMeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	RS(s�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)
    cCs�tt|�j�|s2tjj|�s2t�|p;d|_||_	||_
ddh}|j
j|�|ks}t�dS(Ntsourcetbinary(tsuperR!t__init__tostpathtisabstAssertionErrortNonet	cache_dirtformat_controltallowed_formatstunion(tselfR+R,R-t_valid_formats((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyR%/s		cCs�|jg}|jdk	rO|jdk	rO|jdj|j|jg��ndj|�}tj|j��j	�}|d |dd!|dd!|dg}|S(s�Get parts of part that must be os.path.joined with cache_dir

        Legacy cache key (pip < 20) for compatibility with older caches.
        t=t#iiiN(
turl_without_fragmentt	hash_nameR*thashtappendtjoinRRRR(R/tlinkt	key_partstkey_urlthashedtparts((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyt_get_cache_path_parts_legacy:s
%(cCs�i|jd6}|jdk	rA|jdk	rA|j||j<n|jrZ|j|d<nt�|d<t�|d<t|�}|d |dd!|dd!|dg}|S(	sEGet parts of part that must be os.path.joined with cache_dir
        turltsubdirectoryRRiiiN(R3R4R*R5tsubdirectory_fragmentRRR (R/R8R9R;R<((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyt_get_cache_path_partsVs	

(c	Cs�|jp|p|}|r"gS|jj|�}|jj|�sJgSg}|j|�}tjj|�r�x-tj	|�D]}|j
||f�q�Wn|j|�}tjj|�r�x-tj	|�D]}|j
||f�q�Wn|S(N(R+R,tget_allowed_formatsR-tintersectiontget_path_for_linkR&R'tisdirtlistdirR6tget_path_for_link_legacy(	R/R8tcanonical_package_namet
can_not_cachetformatst
candidatesR't	candidatetlegacy_path((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyt_get_candidatesys&
		cCs
t��dS(N(tNotImplementedError(R/R8((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyRG�scCs
t��dS(s>Return a directory to store cached items in for link.
        N(RO(R/R8((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyRD�scCs
t��dS(saReturns a link to a cached item if it exists, otherwise returns the
        passed link.
        N(RO(R/R8tpackage_nametsupported_tags((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pytget�s
(
t__name__t
__module__t__doc__R%R=RARNRGRDRR(((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyR!$s				#			tSimpleWheelCachecBs2eZdZd�Zd�Zd�Zd�ZRS(s+A cache of wheels for future installs.
    cCs#tt|�j||dh�dS(NR#(R$RVR%(R/R+R,((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyR%�scCs7|j|�}|jst�tjj|jd|�S(Ntwheels(R=R+R)R&R'R7(R/R8R<((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyRG�scCs7|j|�}|jst�tjj|jd|�S(s�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.
        RW(RAR+R)R&R'R7(R/R8R<((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyRD�sc
Cs	g}|s|St|�}x�|j||�D]�\}}yt|�}Wntk
raq/nXt|j�|kr�tjd|||�q/n|j|�s�q/n|j|j	|�||f�q/W|s�|St
|�\}	}}ttt
jj||���S(NsWIgnoring cached wheel %s for %s as it does not match the expected distribution name %s.(RRNRRtnametloggertdebugt	supportedR6tsupport_index_mintminRR	R&R'R7(
R/R8RPRQRKRHt
wheel_namet	wheel_dirtwheelt_((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyRR�s2	

(RSRTRUR%RGRDRR(((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyRV�s
			tEphemWheelCachecBseZdZd�ZRS(sGA SimpleWheelCache that creates it's own temporary cache directory
    cCs>tdtjdt�|_tt|�j|jj|�dS(Ntkindtglobally_managed(	RRtEPHEM_WHEEL_CACHERt	_temp_dirR$RbR%R'(R/R,((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyR%s
	(RSRTRUR%(((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyRb�st
CacheEntrycBseZd�ZRS(cCs||_||_dS(N(R8t
persistent(R/R8Rh((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyR%s	(RSRTR%(((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyRgst
WheelCachecBsDeZdZd�Zd�Zd�Zd�Zd�Zd�ZRS(s�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.
    cCsDtt|�j||dh�t||�|_t|�|_dS(NR#(R$RiR%RVt_wheel_cacheRbt_ephem_cache(R/R+R,((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyR%scCs|jj|�S(N(RjRG(R/R8((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyRG'scCs|jj|�S(N(RjRD(R/R8((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyRD+scCs|jj|�S(N(RkRD(R/R8((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pytget_ephem_path_for_link/scCs,|j|||�}|dkr%|S|jS(N(tget_cache_entryR*R8(R/R8RPRQtcache_entry((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyRR3scCs~|jjd|d|d|�}||k	r=t|dt�S|jjd|d|d|�}||k	rzt|dt�SdS(s�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.
        R8RPRQRhN(RjRRRgRRktFalseR*(R/R8RPRQtretval((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyRm?s		(	RSRTRUR%RGRDRlRRRm(((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyRis					(*RURRtloggingR&tpip._vendor.packaging.tagsRRtpip._vendor.packaging.utilsRtpip._internal.exceptionsRtpip._internal.models.linkRtpip._internal.models.wheelRtpip._internal.utils.temp_dirRRtpip._internal.utils.typingRtpip._internal.utils.urlsR	ttypingR
RRR
RRt#pip._internal.models.format_controlRt	getLoggerRSRYR tobjectR!RVRbRgRi(((sD/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cache.pyt<module>s.(	�R

Zerion Mini Shell 1.0