Rel fUddlZddlZddlmZmZmZddlmZddlmZm Z m Z ddl m Z ddl mZddlmZddlmZ dd lmZn #e$rdZYnwxYwd ed ed efd Zee eZeed<GddZGddeZGdde ZGddZGddZGddeeeZGddeeZGddeeZ Gdd eeZ!Gd!d"ee Z"Gd#d$eeZ#Gd%d&eeee Z$e e fee$fe!e$fe"e$fe#e$fd'Z%d)d(Z&dS)*N)SIGINTdefault_int_handlersignal)Any)BarFillingCirclesBarIncrementalBar)Spinner)WINDOWS)get_indentation) format_size)colorama preferredfallbackreturnc6t|jdd}|s|St|ddt|ddg}|tt|dgz } d|||S#t $r|cYSwxYw)Nencoding empty_fillfillphases)getattrfilelistjoinencodeUnicodeEncodeError)rrr characterss /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-3.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_internal/cli/progress_bars.py_select_progress_classr sy~z488H   <,, 62&&J$wy(B77888J   ""8,,, s(B BB_BaseBarcBeZdZdZdededdffd Zd fd ZdZxZS) 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. argskwargsrNctj|i|tt|j|_|jt |_dSdS)z= Save the original SIGINT handler for later. N)super__init__rr handle_sigintoriginal_handlerrselfr$r% __class__s rr(zInterruptibleMixin.__init__EsW $)&))) &vt/A B B  ($7D ! ! ! ) (c|ttt|jdS)z Restore the original SIGINT handler after finishing. This should happen regardless of whether the progress display finishes normally, or gets interrupted. N)r'finishrrr*)r,r-s rr0zInterruptibleMixin.finishVs2 vt,-----r.cZ||||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)r0r*)r,signumframes rr)z InterruptibleMixin.handle_sigint`s-  fe,,,,,r.rN) __name__ __module__ __qualname____doc__rr(r0r) __classcell__r-s@rr#r#3s"8c8S8T888888"......-------r.r#ceZdZddZdS) SilentBarrNcdSNr,s rupdatezSilentBar.updatels r.r4)r5r6r7rAr?r.rr<r<ks(      r.r<ceZdZdZdZdZdZdS) BlueEmojiBar %(percent)d%% )u🔹u🔷u🔵N)r5r6r7suffix bar_prefix bar_suffixrr?r.rrCrCps" FJJ 7FFFr.rCceZdZdededdffd ZedefdZedefdZedefdZ d Z xZ S) DownloadProgressMixinr$r%rNc|tj|i|dtdzz|jz|_dS)NrE)r'r(r messager+s rr(zDownloadProgressMixin.__init__ysA$)&))) O$5$5$9:dlJ r.c*t|jSr>)r indexr@s r downloadedz DownloadProgressMixin.downloaded~s4:&&&r.cP|jdkrdStd|jz dzS)Ngz...z/s)avgr r@s rdownload_speedz$DownloadProgressMixin.download_speeds- 8s??51tx<((4//r.c(|jr d|jSdS)Nzeta r)etaeta_tdr@s r pretty_etaz DownloadProgressMixin.pretty_etas! 8 ('$+'' 'rr.c#K|D](}|V|t|)|dSr>)nextlenr0)r,itxs riterzDownloadProgressMixin.itersL  AGGG IIc!ff     r.) r5r6r7rr(propertystrrPrTrXr^r9r:s@rrJrJxsKcKSKTKKKKKK 'C'''X'0000X0 CX r.rJc,eZdZdededdffd ZxZS) WindowsMixinr$r%rNctrjrd_tj|i|trEtr@t jj_fdj_fdj_dSdSdS)NFc@jjSr>)rwrappedisattyr@srz'WindowsMixin.__init__..sty'8'?'?'A'Ar.c@jjSr>)rreflushr@srrgz'WindowsMixin.__init__..sdi&7&=&=&?&?r.) r hide_cursorr'r(r AnsiToWin32rrfrir+s` rr(zWindowsMixin.__init__s  %t' %$D  $)&)))  @x @ ,TY77DI BAAADI @???DIOOO @ @ @ @r.)r5r6r7rr(r9r:s@rrbrbs_@c@S@T@@@@@@@@@@r.rbc$eZdZejZdZdZdS)BaseDownloadProgressBarrDz0%(downloaded)s %(download_speed)s %(pretty_eta)sN)r5r6r7sysstdoutrrMrFr?r.rrmrms :DG ?FFFr.rmceZdZdS)DefaultDownloadProgressBarNr5r6r7r?r.rrqrqDr.rqceZdZdS)DownloadSilentBarNrrr?r.rrurursr.ruceZdZdS) DownloadBarNrrr?r.rrwrwrsr.rwceZdZdS)DownloadFillingCirclesBarNrrr?r.rryryrsr.ryceZdZdS)DownloadBlueEmojiProgressBarNrrr?r.rr{r{rsr.r{c4eZdZejZdZdefdZddZ dS)DownloadProgressSpinnerz!%(downloaded)s %(download_speed)srct|dstj|j|_t |jS)N_phaser)hasattr itertoolscyclerrrZr@s r next_phasez"DownloadProgressSpinner.next_phases7tY'' 8$?4;77DLDL!!!r.Nc|j|z}|}|j|z}d||rdnd||rdnd|g}||dS)NrrE)rMrrFrwriteln)r,rMphaserFlines rrAzDownloadProgressSpinner.updates|,%!!t#ww&B%2     Tr.r4) r5r6r7rnrorrFr`rrAr?r.rr}r}sQ :D 0F"C"""" r.r})offonasciiprettyemojic||dkrt|djSt|d|jS)NrrR)max) BAR_TYPESr^) progress_barrs rDownloadProgressProviderrsF {cQhh&q)++00&q)c22277r.r>)'rrnrrrtypingrpip._vendor.progress.barrrr pip._vendor.progress.spinnerr pip._internal.utils.compatr pip._internal.utils.loggingr pip._internal.utils.miscr pip._vendorr Exceptionr r!__annotations__r#r<rCrJrbrmrqrurwryr{r}rrr?r.rrs 6666666666KKKKKKKKKK000000......777777000000$$$$$$$HHHcSS6'&~s;;#;;;5-5-5-5-5-5-5-5-p        88888>888@@@@@@@@@:@@@@@l,>@U@@@     !8(        /        )3        79J        #:L   $&;W< 0 1 %'> ?2 3(*AB*,C D    888888sAA A