Your IP : 18.119.133.214


Current Path : /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.pyc

�
�Rec@@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((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/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((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/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((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/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((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyt
get_delete@s(t__name__t
__module__t__doc__RRR (((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/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((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyttempdir_registryKs
		t_DefaultcB@seZRS((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/_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�tdk	s�t�tj
|�ndS(N(tsuperRRt_defaulttNonetFalset_createt_patht_deletedtdeleteRRtAssertionErrort
enter_context(RtpathR0Rtglobally_managed((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyRvs						cC@s)|js"tdj|j���|jS(Ns$Attempted to access deleted path: {}(R/R1tformatR.(R((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyR3�s
cC@sdj|jj|j�S(Ns	<{} {!r}>(R5t	__class__R!R3(R((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyt__repr__�scC@s|S(N((R((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/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((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/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(tosR3trealpathttempfiletmkdtempR5tloggertdebug(RRR3((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/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>R3texistsR.RR(R((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyR9�s	N(R!R"R#R+R*R,RtpropertyR3R7R8R<R-R9(((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/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)RFR(RRHR0((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/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((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/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>R3tsplitRHRVRPtmkdirtOSErrorterrnotEEXISTR?R@RAR5RBRC(RRtrootRRRTR3tex((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyR-�s
	N(	R!R"R#ROR+RtclassmethodRVR-(((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyRF�s

(*t
__future__RRZRMtloggingtos.pathR>R@t
contextlibRtpip._vendor.contextlib2Rtpip._vendor.sixRtpip._internal.utils.miscRRtpip._internal.utils.typingRttypingRRR	R
RRR
t	getLoggerR!RBt
tempdir_kindsR+RRtobjectRR$R&R'R*RRF(((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/temp_dir.pyt<module>s6.		i

?>