Your IP : 3.149.255.239


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

�
�Rec@s�ddlZddlZddlZddlmZmZmZmZddlm	Z	m
Z
mZddlm
Z
mZdZe
dk	r�e	�Zndefd��YZdefd	��YZdS(
i����Ni(tAnsiForetAnsiBackt	AnsiStyletStyle(tWinTermtWinColortWinStyle(twindlltwinapi_testt
StreamWrappercBsSeZdZd�Zd�Zd�Zd�Zd�Zd�Ze	d��Z
RS(s�
    Wraps a stream (such as stdout), acting as a transparent proxy for all
    attribute access apart from method 'write()', which is delegated to our
    Converter instance.
    cCs||_||_dS(N(t_StreamWrapper__wrappedt_StreamWrapper__convertor(tselftwrappedt	converter((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/colorama/ansitowin32.pyt__init__s	cCst|j|�S(N(tgetattrR
(Rtname((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/colorama/ansitowin32.pyt__getattr__scOs|jj||�S(N(R
t	__enter__(Rtargstkwargs((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/colorama/ansitowin32.pyRscOs|jj||�S(N(R
t__exit__(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/colorama/ansitowin32.pyR%scCs|jj|�dS(N(Rtwrite(Rttext((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/colorama/ansitowin32.pyR(scCsv|j}dtjkrI|dk	rI|tjksB|tjkrItSny
|j}Wnt	k
rjt
SX|�SdS(NtPYCHARM_HOSTED(R
tostenvirontNonetsyst
__stdout__t
__stderr__tTruetisattytAttributeErrortFalse(Rtstreamt
stream_isatty((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/colorama/ansitowin32.pyR!+s	*

cCs-|j}y|jSWntk
r(tSXdS(N(R
tclosedR"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/colorama/ansitowin32.pyR&7s
	
(t__name__t
__module__t__doc__RRRRRR!tpropertyR&(((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/colorama/ansitowin32.pyR	s						tAnsiToWin32cBs�eZdZejd�Zejd�Zdded�Z	d�Z
d�Zd�Zd�Z
d�Zd	�Zd
�Zd�Zd�Zd
�ZRS(s�
    Implements a 'write()' method which, on Windows, will strip ANSI character
    sequences from the text, and if outputting to a tty, will convert them into
    win32 function calls.
    s?\[((?:\d|;)*)([a-zA-Z])?s?\]((?:.|;)*?)()?cCs�||_||_t||�|_tjdk}|o?t�}|dkrt|pn|jjon|jj	�}n||_
|dkr�|o�|jjo�|jj	�}n||_|j�|_
|jtjk|_dS(Ntnt(R
t	autoresetR	R$RRRRR&R!tstriptconverttget_win32_callstwin32_callsRtstderrt	on_stderr(RR
R/R.R-t
on_windowstconversion_supported((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/colorama/ansitowin32.pyRIs		&	%	cCs|jp|jp|jS(sj
        True if this class is actually needed. If false, then the output
        stream will not be affected, nor will win32 calls be issued, so
        wrapping stdout is not actually required. This will generally be
        False on non-Windows platforms, unless optional functionality like
        autoreset has been requested using kwargs to init()
        (R/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/colorama/ansitowin32.pytshould_wrapjscCs||jrutrui&tjftj6tjtjftj6tjtjftj	6tjtjftj6tj
tjft
j6tj
tjft
j6tj
tjft
j6tj
tjft
j6tj
tjft
j6tj
tjft
j6tj
tjft
j6tj
tjft
j6tj
ft
j6tj
tjtft
j6tj
tjtft
j6tj
tjtft
j6tj
tjtft
j6tj
tjtft
j6tj
tjtft
j6tj
tjtft
j6tj
tjtft
j6tj tjft!j6tj tjft!j6tj tjft!j6tj tjft!j6tj tjft!j6tj tjft!j6tj tjft!j6tj tjft!j6tj ft!j6tj tjtft!j6tj tjtft!j6tj tjtft!j6tj tjtft!j6tj tjtft!j6tj tjtft!j6tj tjtft!j6tj tjtft!j6St"�S(N(#R/twintermt	reset_allRt	RESET_ALLtstyleRtBRIGHTtNORMALtDIMtforeRtBLACKRtREDtGREENtYELLOWtBLUEtMAGENTAtCYANtGREYtWHITEtRESETR t
LIGHTBLACK_EXtLIGHTRED_EXt
LIGHTGREEN_EXtLIGHTYELLOW_EXtLIGHTBLUE_EXtLIGHTMAGENTA_EXtLIGHTCYAN_EXt
LIGHTWHITE_EXtbackRtdict(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/colorama/ansitowin32.pyR0tsRcCsY|js|jr"|j|�n|jj|�|jj�|jrU|j�ndS(N(R.R/twrite_and_convertR
RtflushR-R8(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/colorama/ansitowin32.pyR�s
	cCsM|jr|jdd�n-|jrI|jjrI|jjtj�ndS(Ntmi(i(	R/t
call_win32R.R$R&R
RRR9(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/colorama/ansitowin32.pyR8�s	cCs�d}|j|�}xX|jj|�D]D}|j�\}}|j|||�|j|j��|}q(W|j||t|��dS(s�
        Write the given text to our wrapped stream, stripping any ANSI
        sequences from the text, and optionally converting them into win32
        calls.
        iN(tconvert_osctANSI_CSI_REtfinditertspantwrite_plain_texttconvert_ansitgroupstlen(RRtcursortmatchtstarttend((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/colorama/ansitowin32.pyRS�s
cCs7||kr3|jj|||!�|jj�ndS(N(R
RRT(RRRaRb((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/colorama/ansitowin32.pyR[�scCs2|jr.|j||�}|j||�ndS(N(R/textract_paramsRV(Rtparamstringtcommandtparams((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/colorama/ansitowin32.pyR\�s	cCs�|dkrQtd�|jd�D��}x�t|�dkrM|d
}q.Wn^td�|jd�D��}t|�dkr�|dkr�d}q�|d	kr�d}q�n|S(
NtHfcss3|])}t|�dkr't|�ndVqdS(iiN(R^tint(t.0tp((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/colorama/ansitowin32.pys	<genexpr>�st;iicss-|]#}t|�dkrt|�VqdS(iN(R^Rh(RiRj((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/colorama/ansitowin32.pys	<genexpr>�sitJKmtABCD(i(i(i(ttupletsplitR^(RReRdRf((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/colorama/ansitowin32.pyRc�s	cCse|dkrrxR|D]X}||jkr|j|}|d}|d}td|j�}|||�qqWn�|dkr�tj|dd|j�n�|dkr�tj|dd|j�n�|dkr�tj|d|j�nx|dkra|d}id|fd	6d|fd
6|dfd6|dfd6|\}	}
tj|	|
d|j�ndS(
NRUiiR3tJtKRgRmtAtBtCtD(R1RRR3R7terase_screent
erase_linetset_cursor_positiont
cursor_adjust(RReRftparamt	func_argstfuncRRtntxty((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/colorama/ansitowin32.pyRV�s$




FcCs�x�|jj|�D]~}|j�\}}|| ||}|j�\}}|dkr|jd�}|ddkr�tj|d�q�qqW|S(NsRkit02i(tANSI_OSC_RERYRZR]RoR7t	set_title(RRR`RaRbRdReRf((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/colorama/ansitowin32.pyRW�sN(R'R(R)tretcompileRXR�RR#RR6R0RR8RSR[R\RcRVRW(((s�/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/colorama/ansitowin32.pyR+@s!	
	,	
						(R�RRtansiRRRRR7RRRtwin32RRRtobjectR	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/colorama/ansitowin32.pyt<module>s"0

?>