ok

Mini Shell

Direktori : /opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/
Upload File :
Current File : //opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pyc

�
�2{Yc@s�ddlmZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZddl
mZmZmZmZeje�Zdadefd��YZdefd	��YZd
efd��YZdefd
��YZdefd��YZdefd��YZieed�6ee
j6Z y*ddl!Z!ee 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((sN/opt/alt/python33/lib/python3.3/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	((sN/opt/alt/python33/lib/python3.3/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((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pytget.s	$	N(t__name__t
__module__RR
RR!(((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pyRs	tResourceBasecBseZd�ZRS(cCs||_||_dS(N(Rtname(RRR%((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pyR
Is	(R"R#R
(((sN/opt/alt/python33/lib/python3.3/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((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pyt	as_streamVscCs%tdkrt�antj|�S(N(tcacheRRR!(R((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pyt	file_path_scCs|jj|�S(N(Rt	get_bytes(R((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pyRfscCs|jj|�S(N(Rtget_size(R((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pytsizejs(
R"R#t__doc__tFalsetis_containerR(RR*RR-(((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pyR&Ns		tResourceContainercBseZeZed��ZRS(cCs|jj|�S(N(Rt
get_resources(R((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pyt	resourcesrs(R"R#RR0RR3(((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pyR1ostResourceFindercBs�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
eejj�ZRS(u4
    Resource finder for file system resources.
    cCsC||_t|dd�|_tjjt|dd��|_dS(Nu
__loader__u__file__u(tmoduletgetattrRtloaderRR	RR(RR5((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pyR
{s	cCstjj|�S(N(RR	trealpath(RR	((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pyt_adjust_path�scCsA|jd�}|jd|j�tjj|�}|j|�S(Nu/i(tsplittinsertRRR	R
R9(Rt
resource_nametpartsR((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pyt
_make_path�scCstjj|�S(N(RR	R(RR	((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pyt_find�scCs
d|jfS(N(RR	(RR((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pyR�scCsd|j|�}|j|�s'd}n9|j|�rHt||�}nt||�}||_|S(N(R>R?Rt
_is_directoryR1R&R	(RR<R	R((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pytfind�s		cCst|jd�S(Nurb(RR	(RR((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pyR'�scCs)t|jd��}|j�SWdQXdS(Nurb(RR	tread(RRR ((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pyR+�scCstjj|j�S(N(RR	tgetsize(RR((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pyR,�scCs>d�}tgtj|j�D]}||�r|^q�S(NcSs|dko|jd�S(Nu__pycache__u.pycu.pyo(u.pycu.pyo(tendswith(R ((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pytallowed�s(tsetRtlistdirR	(RRRER ((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pyR2�s	cCs|j|j�S(N(R@R	(RR((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pyR0�s(R"R#R.R
R9R>R?RRAR'R+R,R2R0tstaticmethodRR	RR@(((sN/opt/alt/python33/lib/python3.3/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RIR
R7tarchivetlent
prefix_lenthasattrt_filest	zipimportt_zip_directory_cachetsortedtindex(RR5RJ((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pyR
�scCs|S(N((RR	((sN/opt/alt/python33/lib/python3.3/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(RLRNRRtseptbisectRRt
startswitht
IndexErrorR/tloggertdebugR7R(RR	Rti((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pyR?�s
	

cCs-|jj}|jdt|�}||fS(Ni(R7RJR	RK(RRRR	((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pyR�scCs|jj|j�S(N(R7tget_dataR	(RR((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pyR+�scCstj|j|��S(N(tiotBytesIOR+(RR((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pyR'�scCs|j|j}|j|dS(Ni(R	RLRN(RRR	((sN/opt/alt/python33/lib/python3.3/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	RLRRSRKRFRTRRRUtaddR:(RRR	tplenRRYts((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pyR2�s	 cCs�||j}|r6|dtjkr6|tj7}ntj|j|�}y|j|j|�}Wntk
r~t}nX|S(Ni����(RLRRSRTRRRURVR/(RR	RYR((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pyR@�s


(R"R#R.R
R9R?RR+R'R,R2R@(((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pyRI�s								cCs|tt|�<dS(N(t_finder_registryttype(R7tfinder_maker((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pytregister_finder
scCs�|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_cachetsystmodulest
__import__R6RRR`R!Ra(tpackageRR5R	R7Rb((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pyRs



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_importerRetpath_importer_cacheR!R`Rat
_dummy_moduleRR	R
t__file__t
__loader__(R	RR7RR5((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pytfinder_for_path,s
	(-t
__future__RRTR[tloggingRRitshutilRettypesROtRtutilRRRRt	getLoggerR"RWRR)RtobjectR$R&R1R4RIRatzipimporterR`t_frozen_importlibtSourceFileLoadert
FileFindertImportErrortAttributeErrorRcRdRt
ModuleTypeRRlRo(((sN/opt/alt/python33/lib/python3.3/site-packages/pip/_vendor/distlib/resources.pyt<module>sB",!9M


		

Zerion Mini Shell 1.0