Your IP : 18.116.10.48


Current Path : /opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/
Upload File :
Current File : //opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyc

�
�Rec@s	ddlmZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZddl
mZmZmZmZeje�Zdadefd��YZdefd	��YZd
efd��YZdefd
��YZdefd��YZdefd��YZieed�6ee
j6Z yQyddl!Z"Wne#k
r�ddl$Z"nXee e"j%<ee e"j&<["Wne#e'fk
r�nXd�Z(iZ)d�Z*e	j+e,d��Z-d�Z.dS(i����(tunicode_literalsNi(tDistlibException(tcached_propertytget_cache_basetpath_to_cache_dirtCachet
ResourceCachecBs&eZdd�Zd�Zd�ZRS(cCsG|dkr-tjjt�td��}ntt|�j|�dS(Nuresource-cache(	tNonetostpathtjoinRtstrtsuperRt__init__(tselftbase((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR
s!cCstS(u�
        Is the cache stale for the given resource?

        :param resource: The :class:`Resource` being cached.
        :param path: The path of the resource in the cache.
        :return: True if the cache is stale.
        (tTrue(RtresourceR	((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pytis_stale#s	cCs�|jj|�\}}|dkr-|}n�tjj|j|j|�|�}tjj|�}tjj	|�s�tj
|�ntjj|�s�t}n|j
||�}|r�t|d��}|j|j�WdQXn|S(u�
        Get a resource into the cache,

        :param resource: A :class:`Resource` instance.
        :return: The pathname of the resource in the cache.
        uwbN(tfindertget_cache_infoRRR	R
Rt
prefix_to_dirtdirnametisdirtmakedirstexistsRRtopentwritetbytes(RRtprefixR	tresultRtstaletf((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pytget.s	$	N(t__name__t
__module__RR
RR!(((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyRs	tResourceBasecBseZd�ZRS(cCs||_||_dS(N(Rtname(RRR%((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR
Is	(R"R#R
(((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR$HstResourcecBsJeZdZeZd�Zed��Zed��Zed��Z	RS(u�
    A class representing an in-package resource, such as a data file. This is
    not normally instantiated by user code, but rather by a
    :class:`ResourceFinder` which manages the resource.
    cCs|jj|�S(u�
        Get the resource as a stream.

        This is not a property to make it obvious that it returns a new stream
        each time.
        (Rt
get_stream(R((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyt	as_streamVscCs%tdkrt�antj|�S(N(tcacheRRR!(R((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyt	file_path_scCs|jj|�S(N(Rt	get_bytes(R((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyRfscCs|jj|�S(N(Rtget_size(R((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pytsizejs(
R"R#t__doc__tFalsetis_containerR(RR*RR-(((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR&Ns		tResourceContainercBseZeZed��ZRS(cCs|jj|�S(N(Rt
get_resources(R((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyt	resourcesrs(R"R#RR0RR3(((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR1ostResourceFindercBs�eZdZejjd�r'dZndZd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zeejj�Zd�ZRS(u4
    Resource finder for file system resources.
    ujavau.pycu.pyou.classcCsC||_t|dd�|_tjjt|dd��|_dS(Nu
__loader__u__file__u(tmoduletgetattrRtloaderRR	RR(RR5((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR
�s	cCstjj|�S(N(RR	trealpath(RR	((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyt_adjust_path�scCs_t|t�rd}nd}|j|�}|jd|j�tjj|�}|j|�S(Nt/u/i(	t
isinstanceRtsplittinsertRRR	R
R9(Rt
resource_nametseptpartsR((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyt
_make_path�s	cCstjj|�S(N(RR	R(RR	((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyt_find�scCs
d|jfS(N(RR	(RR((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR�scCsd|j|�}|j|�s'd}n9|j|�rHt||�}nt||�}||_|S(N(RARBRt
_is_directoryR1R&R	(RR>R	R((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pytfind�s		cCst|jd�S(Nurb(RR	(RR((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR'�scCs)t|jd��}|j�SWdQXdS(Nurb(RR	tread(RRR ((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR+�scCstjj|j�S(N(RR	tgetsize(RR((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR,�scsD�fd�}tgtj|j�D]}||�r%|^q%�S(Ncs|dko|j�j�S(Nu__pycache__(tendswithtskipped_extensions(R (R(s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pytallowed�s(tsetRtlistdirR	(RRRIR ((Rs�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR2�scCs|j|j�S(N(RCR	(RR((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR0�sccs�|j|�}|dk	r�|g}x�|r�|jd�}|V|jr'|j}xe|jD]W}|sr|}ndj||g�}|j|�}|jr�|j|�q]|Vq]Wq'q'WndS(Niu/(RDRtpopR0R%R3R
tappend(RR>RttodotrnameR%tnew_nametchild((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pytiterator�s 						(u.pycu.pyou.class(u.pycu.pyo(R"R#R.tsystplatformt
startswithRHR
R9RARBRRDR'R+R,R2R0tstaticmethodRR	RRCRR(((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR4ws"												tZipResourceFindercBs_eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�ZRS(
u6
    Resource finder for resources in .zip files.
    cCstt|�j|�|jj}dt|�|_t|jd�rY|jj|_nt	j
||_t|j�|_dS(Niu_files(
RRWR
R7tarchivetlent
prefix_lenthasattrt_filest	zipimportt_zip_directory_cachetsortedtindex(RR5RX((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR
�scCs|S(N((RR	((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR9�scCs�||j}||jkr%t}nr|rN|dtjkrN|tj}ntj|j|�}y|j|j|�}Wntk
r�t	}nX|s�t
jd||jj
�nt
jd||jj
�|S(Ni����u_find failed: %r %ru_find worked: %r %r(RZR\RRR?tbisectR`RUt
IndexErrorR/tloggertdebugR7R(RR	Rti((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyRB�s
	

cCs-|jj}|jdt|�}||fS(Ni(R7RXR	RY(RRRR	((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR�scCs|jj|j�S(N(R7tget_dataR	(RR((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR+�scCstj|j|��S(N(tiotBytesIOR+(RR((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR'�scCs|j|j}|j|dS(Ni(R	RZR\(RRR	((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR,scCs�|j|j}|r9|dtjkr9|tj7}nt|�}t�}tj|j|�}xn|t|j�kr�|j|j|�s�Pn|j||}|j	|j
tjd�d�|d7}qfW|S(Ni����ii(R	RZRR?RYRJRaR`RUtaddR<(RRR	tplenRRets((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR2s	 cCs�||j}|r6|dtjkr6|tj7}ntj|j|�}y|j|j|�}Wntk
r~t}nX|S(Ni����(RZRR?RaR`RURbR/(RR	ReR((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyRCs


(R"R#R.R
R9RBRR+R'R,R2RC(((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyRW�s								cCs|tt|�<dS(N(t_finder_registryttype(R7tfinder_maker((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pytregister_finder0scCs�|tkrt|}n�|tjkr5t|�ntj|}t|dd�}|dkrotd��nt|dd�}tjt	|��}|dkr�td|��n||�}|t|<|S(u�
    Return a resource finder for a package.
    :param package: The name of the package.
    :return: A :class:`ResourceFinder` instance for the package.
    u__path__u8You cannot get a finder for a module, only for a packageu
__loader__uUnable to locate finder for %rN(
t
_finder_cacheRStmodulest
__import__R6RRRlR!Rm(tpackageRR5R	R7Rn((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR6s



u	__dummy__cCszd}tj|�tjj|�}tjt|��}|rvt}t	j
j|d�|_||_
||�}n|S(u�
    Return a resource finder for a path, which should represent a container.

    :param path: The path.
    :return: A :class:`ResourceFinder` instance for the path.
    uN(Rtpkgutiltget_importerRStpath_importer_cacheR!RlRmt
_dummy_moduleRR	R
t__file__t
__loader__(R	RR7RR5((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pytfinder_for_pathRs
	(/t
__future__RRaRgtloggingRRttshutilRSttypesR]tRtutilRRRRt	getLoggerR"RcRR)RtobjectR$R&R1R4RWRmtzipimporterRlt_frozen_importlib_externalt_fitImportErrort_frozen_importlibtSourceFileLoadert
FileFindertAttributeErrorRoRpRt
ModuleTypeRRwRz(((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyt<module>sJ",!ZM




		

?>