Re@sIddlmZmZddlZddlZddlZddlZddlZddlm Z m Z ddl m Z ddl mZddlmZerddlmZmZejeZGdd d eZGd d d eZGd d d eZGdddeZejddZejddZdS))absolute_importdivisionN) HIDE_CURSOR SHOW_CURSOR)WINDOWS)get_indentation)MYPY_CHECK_RUNNING)IteratorIOc@s(eZdZddZddZdS)SpinnerInterfacecCs tdS)N)NotImplementedError)selfr/builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/cli/spinners.pyspinszSpinnerInterface.spincCs tdS)N)r )r final_statusrrrfinishszSpinnerInterface.finishN)__name__ __module__ __qualname__rrrrrrr s  r c@sIeZdZdddddZddZdd Zd d ZdS) InteractiveSpinnerNz-\|/g?cCs||_|dkrtj}||_t||_d|_tj||_ |jj dt |jdd|_ dS)NF z ... r) _messagesysstdout_file RateLimiter _rate_limiter _finished itertoolscycle _spin_cyclewriter_width)r messagefile spin_charsmin_update_interval_secondsrrr__init__ s     "zInteractiveSpinner.__init__cCsy|j std|j}|jj|d|j||jj|t||_|jj|jjdS)Nr) rAssertionErrorr#rr"lenflushrreset)r statusbackuprrr_write0s  zInteractiveSpinner._writecCs:|jr dS|jjs dS|jt|jdS)N)rrreadyr0nextr!)r rrrr=s  zInteractiveSpinner.spincCsD|jr dS|j||jjd|jjd|_dS)N T)rr0rr"r,)r rrrrrEs    zInteractiveSpinner.finish)rrrr(r0rrrrrrrs  rc@sCeZdZdddZddZddZdd Zd S) NonInteractiveSpinner<cCs2||_d|_t||_|jddS)NFstarted)rrrr_update)r r$r'rrrr(Ts  zNonInteractiveSpinner.__init__cCs7|j st|jjtjd|j|dS)Nz%s: %s)rr*rr-loggerinfor)r r.rrrr7[s zNonInteractiveSpinner._updatecCs1|jr dS|jjs dS|jddS)Nzstill running...)rrr1r7)r rrrras  zNonInteractiveSpinner.spincCs3|jr dS|jdjtd|_dS)Nz%finished with status '{final_status}'T)rr7formatlocals)r rrrrris  zNonInteractiveSpinner.finishN)rrrr(r7rrrrrrr4Ss   r4c@s4eZdZddZddZddZdS)rcCs||_d|_dS)Nr)_min_update_interval_seconds _last_update)r r'rrrr(ss zRateLimiter.__init__cCs&tj}||j}||jkS)N)timer=r<)r nowdeltarrrr1xs  zRateLimiter.readycCstj|_dS)N)r>r=)r rrrr-~szRateLimiter.resetN)rrrr(r1r-rrrrrrs   rccstjjr3tjtjkr3t|}n t|}y t tj |VWdQRXWnCt k r|j dYn/t k r|j dYnX|j ddS)Ncancelederrordone) rrisattyr8getEffectiveLevelloggingINFOrr4 hidden_cursorKeyboardInterruptr Exception)r$spinnerrrr open_spinners$     rLc csctrdVnQ|j s0tjtjkr8dVn'|jtz dVWd|jtXdS)N) rrDr8rErFrGr"rr)r%rrrrHs"  rH) __future__rr contextlibrrFrr>Zpip._vendor.progressrrpip._internal.utils.compatrpip._internal.utils.loggingrpip._internal.utils.typingrtypingr r getLoggerrr8objectr rr4rcontextmanagerrLrHrrrrs$      4