ó ïRec@sÆddlZddlZddlZddlmZmZmZmZddlm Z m Z m Z ddl m Z mZdZe dk r–e ƒZndefd„ƒYZdefd „ƒYZdS( iÿÿÿÿNi(tAnsiForetAnsiBackt AnsiStyletStyle(tWinTermtWinColortWinStyle(twindllt winapi_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(R twrite(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      t AnsiToWin32cBs˜eZdZejdƒZejdƒZdded„Z d„Z d„Z d„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_callst win32_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.pyt should_wrapjscCs||jrutrui&tjftj6tjtjftj6tjtjftj 6tjtjftj6tj t j ft j 6tj t jft j6tj t jft j6tj t jft j6tj t jft j6tj t jft j6tj t jft j6tj t jft j6tj ft j6tj t j tft j6tj t jtft j6tj t jtft j6tj t jtft j6tj t jtft j6tj t jtft j6tj t jtft j6tj t jtft j6tj t j ft!j 6tj t jft!j6tj t jft!j6tj t jft!j6tj t jft!j6tj t jft!j6tj t jft!j6tj t jft!j6tj ft!j6tj t j tft!j6tj t jtft!j6tj t jtft!j6tj t jtft!j6tj t jtft!j6tj t jtft!j6tj t jtft!j6tj t jtft!j6St"ƒS(N(#R/twintermt reset_allRt RESET_ALLtstyleRtBRIGHTtNORMALtDIMtforeRtBLACKRtREDtGREENtYELLOWtBLUEtMAGENTAtCYANtGREYtWHITEtRESETR t LIGHTBLACK_EXt LIGHTRED_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 cCsd}|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(t convert_osct ANSI_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 t paramstringtcommandtparams((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ƒƒ}xt|ƒ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 Ï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 Ô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     c Cse|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|dfd 6| 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(t ANSI_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)tretcompileRXRRR#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.pyts   "  0