/usr/lib/python3.6/site-packages/pip/utils/__pycache__
NameSizeModeActions
appdirs.cpython-36.opt-1.pyc76820644editdlrm
appdirs.cpython-36.pyc76820644editdlrm
build.cpython-36.opt-1.pyc12960644editdlrm
build.cpython-36.pyc12960644editdlrm
deprecation.cpython-36.opt-1.pyc17090644editdlrm
deprecation.cpython-36.pyc17090644editdlrm
encoding.cpython-36.opt-1.pyc9990644editdlrm
encoding.cpython-36.pyc9990644editdlrm
filesystem.cpython-36.opt-1.pyc5640644editdlrm
filesystem.cpython-36.pyc5640644editdlrm
glibc.cpython-36.opt-1.pyc13470644editdlrm
glibc.cpython-36.pyc13470644editdlrm
hashes.cpython-36.opt-1.pyc32230644editdlrm
hashes.cpython-36.pyc32230644editdlrm
logging.cpython-36.opt-1.pyc38790644editdlrm
logging.cpython-36.pyc38790644editdlrm
outdated.cpython-36.opt-1.pyc47110644editdlrm
outdated.cpython-36.pyc47110644editdlrm
packaging.cpython-36.opt-1.pyc19670644editdlrm
packaging.cpython-36.pyc19670644editdlrm
setuptools_build.cpython-36.opt-1.pyc3080644editdlrm
setuptools_build.cpython-36.pyc3080644editdlrm
ui.cpython-36.opt-1.pyc95050644editdlrm
ui.cpython-36.pyc95640644editdlrm
__init__.cpython-36.opt-1.pyc225890644editdlrm
__init__.cpython-36.pyc226340644editdlrm
Edit: /usr/lib/python3.6/site-packages/pip/utils/__pycache__/ui.cpython-36.pyc (9564B)
3 PfM-@sddlmZddlmZddlZddlZddlmZmZmZddlZddl Z ddl Z ddl m Z ddl mZddlmZddlmZdd lmZmZdd lmZmZmZdd lmZydd lmZWnek rdZYnXe jeZ d dZ!e!eeZ"Gddde#Z$Gddde#Z%Gddde#Z&Gddde&e$e%e"Z'Gddde&e$e%eeZ(e j)ddZ*Gddde#Z+Gddde#Z,Gdd d e#Z-e j)d!d"Z.dS)#)absolute_import)divisionN)signalSIGINTdefault_int_handler)WINDOWS) format_size)get_indentation)six)BarIncrementalBar) WritelnMixin HIDE_CURSOR SHOW_CURSOR)Spinner)coloramac Cst|jdd}|s|St|dtjt|dtjg}|tt|dg7}ytjj|j|Wntk rv|SX|SdS)NencodingZ empty_fillZfillphases)getattrfiler Z text_typelistjoinencodeUnicodeEncodeError)Z preferredZfallbackrZ charactersr/usr/lib/python3.6/ui.py_select_progress_classsrcs4eZdZdZfddZfddZddZZS)InterruptibleMixina Helper to ensure that self.finish() gets called on keyboard interrupt. This allows downloads to be interrupted without leaving temporary state (like hidden cursors) behind. This class is similar to the progress library's existing SigIntMixin helper, but as of version 1.2, that helper has the following problems: 1. It calls sys.exit(). 2. It discards the existing SIGINT handler completely. 3. It leaves its own handler in place even after an uninterrupted finish, which will have unexpected delayed effects if the user triggers an unrelated keyboard interrupt some time after a progress-displaying download has already completed, for example. cs4tt|j||tt|j|_|jdkr0t|_dS)z= Save the original SIGINT handler for later. N)superr__init__rr handle_sigintoriginal_handlerr)selfargskwargs) __class__rrrNs zInterruptibleMixin.__init__cstt|jtt|jdS)z Restore the original SIGINT handler after finishing. This should happen regardless of whether the progress display finishes normally, or gets interrupted. N)rrfinishrrr!)r")r%rrr&^szInterruptibleMixin.finishcCs|j|j||dS)z Call self.finish() before delegating to the original SIGINT handler. This handler should only be in place while the progress display is active. N)r&r!)r"Zsignumframerrrr hsz InterruptibleMixin.handle_sigint)__name__ __module__ __qualname____doc__rr&r __classcell__rr)r%rr<s  rcsJeZdZfddZeddZeddZeddZd d d ZZ S) DownloadProgressMixincs,tt|j||dtd|j|_dS)N )rr-rr message)r"r#r$)r%rrruszDownloadProgressMixin.__init__cCs t|jS)N)rindex)r"rrr downloadedysz DownloadProgressMixin.downloadedcCs |jdkrdStd|jdS)Ngz...z/s)Zavgr)r"rrrdownload_speed}s z$DownloadProgressMixin.download_speedcCs|jrd|jSdS)Nzeta %s)ZetaZeta_td)r"rrr pretty_etas z DownloadProgressMixin.pretty_etar3ccs*x|D]}|V|j|qW|jdS)N)nextr&)r"itnxrrriters zDownloadProgressMixin.iter)r3) r(r)r*rpropertyr2r4r6r;r,rr)r%rr-ss     r-cseZdZfddZZS) WindowsMixincs\trjrd_ttj||trXtrXtjj_fddj_fddj_ dS)NFcs jjjS)N)rwrappedisattyr)r"rrsz'WindowsMixin.__init__..cs jjjS)N)rr>flushr)r"rrr@s) rZ hide_cursorrr=rrZ AnsiToWin32rr?rA)r"r#r$)r%)r"rrs zWindowsMixin.__init__)r(r)r*rr,rr)r%rr=sr=c@seZdZejZdZdZdS)DownloadProgressBarz %(percent)d%%z0%(downloaded)s %(download_speed)s %(pretty_eta)sN)r(r)r*sysstdoutrr0suffixrrrrrBsrBc@s&eZdZejZdZddZddZdS)DownloadProgressSpinnerz!%(downloaded)s %(download_speed)scCs"t|dstj|j|_t|jS)N_phaser)hasattr itertoolscyclerrGr7)r"rrr next_phases z"DownloadProgressSpinner.next_phasecCsN|j|}|j}|j|}dj||r*dnd||r6dnd|g}|j|dS)Nr5r.)r0rKrErZwriteln)r"r0ZphaserElinerrrupdates    zDownloadProgressSpinner.updateN) r(r)r*rCrDrrErKrMrrrrrFsrFc csRtr dVnB|j s$tjtjkr,dVn"|jtz dVWd|jtXdS)N) rr?loggergetEffectiveLevelloggingINFOwriterr)rrrr hidden_cursors  rSc@s$eZdZddZddZddZdS) RateLimitercCs||_d|_dS)Nr)_min_update_interval_seconds _last_update)r"min_update_interval_secondsrrrrszRateLimiter.__init__cCstj}||j}||jkS)N)timerVrU)r"ZnowZdeltarrrreadys zRateLimiter.readycCstj|_dS)N)rXrV)r"rrrresetszRateLimiter.resetN)r(r)r*rrYrZrrrrrTsrTc@s.eZdZd ddZddZdd Zd d ZdS) InteractiveSpinnerN-\|/?cCs\||_|dkrtj}||_t||_d|_tj||_ |jj dt |jdd|_ dS)NFr.z ... r) _messagerCrD_filerT _rate_limiter _finishedrIrJ _spin_cyclerRr _width)r"r0rZ spin_charsrWrrrrs  zInteractiveSpinner.__init__cCs^|j s td|j}|jj|d|j||jj|t||_|jj|jjdS)Nr.) raAssertionErrorrcr_rRlenrAr`rZ)r"statusZbackuprrr_write s     zInteractiveSpinner._writecCs,|jr dS|jjsdS|jt|jdS)N)rar`rYrhr7rb)r"rrrspins  zInteractiveSpinner.spincCs4|jr dS|j||jjd|jjd|_dS)N T)rarhr_rRrA)r" final_statusrrrr&s    zInteractiveSpinner.finish)Nr\r])r(r)r*rrhrir&rrrrr[s   r[c@s.eZdZd ddZddZddZdd Zd S) NonInteractiveSpinner<cCs$||_d|_t||_|jddS)NFZstarted)r^rarTr`_update)r"r0rWrrrr*s zNonInteractiveSpinner.__init__cCs*|j s t|jjtjd|j|dS)Nz%s: %s)rarer`rZrNinfor^)r"rgrrrrn0s  zNonInteractiveSpinner._updatecCs&|jr dS|jjsdS|jddS)Nzstill running...)rar`rYrn)r"rrrri5s  zNonInteractiveSpinner.spincCs$|jr dS|jd|fd|_dS)Nzfinished with status '%s'T)rarn)r"rkrrrr&<szNonInteractiveSpinner.finishN)rm)r(r)r*rrnrir&rrrrrl)s rlccstjjr"tjtjkr"t|}nt|}y t tj |VWdQRXWn>t k rj|j dYn*t k r|j dYn X|j ddS)NZcancelederrordone) rCrDr?rNrOrPrQr[rlrSKeyboardInterruptr& Exception)r0Zspinnerrrr open_spinnerCs    rt)/Z __future__rrrIrCrrrrX contextlibrPZ pip.compatrZ pip.utilsrZpip.utils.loggingr Z pip._vendorr Zpip._vendor.progress.barr r Zpip._vendor.progress.helpersr rrZpip._vendor.progress.spinnerrrrsZ getLoggerr(rNrZ_BaseBarobjectrr-r=rBrFcontextmanagerrSrTr[rlrtrrrrsB          7 !0