ok

Mini Shell

Direktori : /opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/
Upload File :
Current File : //opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyo

�
x�_c@@s�ddlmZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddlm
Z
ddlmZmZddlmZer�ddlmZmZmZmZmZmZed	d
d�Zneje�Zedd
dddd�Zda e	d��Z!de"fd��YZ#da$e	d��Z%de"fd��YZ&e&�Z'de"fd��YZ(de(fd��YZ)dS(i(tabsolute_importN(tcontextmanager(t	ExitStack(tensure_text(tenumtrmtree(tMYPY_CHECK_RUNNING(tAnytDicttIteratortOptionaltTypeVartUniont_Ttboundt
TempDirectoryt	BUILD_ENVs	build-envtEPHEM_WHEEL_CACHEsephem-wheel-cachet	REQ_BUILDs	req-buildcc@s6t��'}t|}az	dVWd|aXWdQXdS(N(Rt_tempdir_manager(tstacktold_tempdir_manager((sM/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pytglobal_tempdir_manager%s

	tTempDirectoryTypeRegistrycB@s)eZdZd�Zd�Zd�ZRS(s$Manages temp directory behavior
    cC@s
i|_dS(N(t_should_delete(tself((sM/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyt__init__5scC@s||j|<dS(s[Indicate whether a TempDirectory of the given kind should be
        auto-deleted.
        N(R(Rtkindtvalue((sM/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyt
set_delete9scC@s|jj|t�S(s^Get configured auto-delete flag for a given TempDirectory type,
        default True.
        (RtgettTrue(RR((sM/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyt
get_delete@s(t__name__t
__module__t__doc__RRR (((sM/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyR1s		cc@s&t}t�az	tVWd|aXdS(suProvides a scoped global tempdir registry that can be used to dictate
    whether directories should be deleted.
    N(t_tempdir_registryR(told_tempdir_registry((sM/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyttempdir_registryKs
		t_DefaultcB@seZRS((R!R"(((sM/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyR'ZscB@s_eZdZd	eded�Zed��Zd�Z	d�Z
d�Zd�Zd�Z
RS(
sMHelper class that owns and cleans up a temporary directory.

    This class can be used as a context manager or as an OO representation of a
    temporary directory.

    Attributes:
        path
            Location to the created temporary directory
        delete
            Whether the directory should be deleted when exiting
            (when used as a contextmanager)

    Methods:
        cleanup()
            Deletes the temporary directory

    When used as a context manager, if the delete attribute is True, on
    exiting the context the temporary directory is deleted.
    ttempcC@s�tt|�j�|tkr=|dk	r4t}q=d}n|dkr[|j|�}n||_t|_||_	||_
|r�tj|�ndS(N(
tsuperRRt_defaulttNonetFalset_createt_patht_deletedtdeleteRRt
enter_context(RtpathR0Rtglobally_managed((sM/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyRvs						cC@s|jS(N(R.(R((sM/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyR2�scC@sdj|jj|j�S(Ns	<{} {!r}>(tformatt	__class__R!R2(R((sM/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyt__repr__�scC@s|S(N((R((sM/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyt	__enter__�scC@sS|jdk	r|j}n!tr6tj|j�}nt}|rO|j�ndS(N(R0R+R$R RRtcleanup(RtexcRttbR0((sM/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyt__exit__�scC@s;tjjtjddj|���}tjd|�|S(sECreate a temporary directory and store its path in self.path
        tprefixspip-{}-sCreated temporary directory: %s(tosR2trealpathttempfiletmkdtempR4tloggertdebug(RRR2((sM/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyR-�s	cC@s8t|_tjj|j�r4tt|j��ndS(s?Remove the temporary directory created and reset state
        N(RR/R=R2texistsR.RR(R((sM/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyR8�s	N(R!R"R#R+R*R,RtpropertyR2R6R7R;R-R8(((sM/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyRas				tAdjacentTempDirectorycB@s8eZdZdZdd�Zed��Zd�ZRS(s�Helper class that creates a temporary directory adjacent to a real one.

    Attributes:
        original
            The original directory to create a temp directory for.
        path
            After calling create() or entering, contains the full
            path to the temporary directory.
        delete
            Whether the directory should be deleted when exiting
            (when used as a contextmanager)

    s-~.=%0123456789cC@s/|jd�|_tt|�jd|�dS(Ns/\R0(trstriptoriginalR)RER(RRGR0((sM/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyR�scc@s�xptdt|��D]Y}xPtj|j|d�D]5}ddj|�||}||kr6|Vq6q6WqWxhtt|j��D]Q}xHtj|j|�D]1}ddj|�|}||kr�|Vq�q�Wq�WdS(sGenerates a series of temporary names.

        The algorithm replaces the leading characters in the name
        with ones that are valid filesystem characters, but are not
        valid package names (for both Python and pip definitions of
        package).
        it~tN(trangetlent	itertoolstcombinations_with_replacementt
LEADING_CHARStjoin(tclstnametit	candidatetnew_name((sM/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyt_generate_names�s
		cC@s�tjj|j�\}}x�|j|�D]m}tjj||�}ytj|�Wn+tk
r�}|jtj	kr��q�q+Xtjj
|�}Pq+Wtjj
tjddj
|���}tjd|�|S(NR<spip-{}-sCreated temporary directory: %s(R=R2tsplitRGRUROtmkdirtOSErrorterrnotEEXISTR>R?R@R4RARB(RRtrootRQRSR2tex((sM/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyR-�s
	N(	R!R"R#RNR+RtclassmethodRUR-(((sM/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyRE�s

(*t
__future__RRYRLtloggingtos.pathR=R?t
contextlibRtpip._vendor.contextlib2Rtpip._vendor.sixRtpip._internal.utils.miscRRtpip._internal.utils.typingRttypingRRR	R
RRR
t	getLoggerR!RAt
tempdir_kindsR+RRtobjectRR$R&R'R*RRE(((sM/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyt<module>s6.		i

Zerion Mini Shell 1.0