HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //lib/python2.7/dist-packages/apt/progress/text.pyc
�
&��cc@s]dZddlmZddlZddlZddlZddlZy<ddlZddlm	Z	m
Z
mZee	e
eWnek
r�nXddl
Z
ddlmZedddgZejjd	kr�eZneZd
�Zdefd��YZdejefd
��YZdejefd��YZdejefd��YZdS(s'Progress reporting for text interfaces.i����(tprint_functionN(tCallabletOptionaltUnion(tbasetAcquireProgresst
CdromProgresst
OpProgressicCs4tj|�}||kr0tj|d�}n|S(s>Translate the message, also try apt if translation is missing.tapt(tapt_pkgtgettext(tmsgtres((s5/usr/lib/python2.7/dist-packages/apt/progress/text.pyt_2stTextProgresscBs)eZdZdd�Zeed�ZRS(s.Internal Base class for text progress classes.cCs|ptj|_d|_dS(Ni(tsyststdoutt_filet_width(tselftoutfile((s5/usr/lib/python2.7/dist-packages/apt/progress/text.pyt__init__>scCs�|jjd�|jj|�|jt|�krY|jj|jt|�d�n$|r}t|jt|��|_n|r�|jjd�n
|jj�dS(s8Write the message on the terminal, fill remaining space.s
t s
N(RtwriteRtlentmaxtflush(RRtnewlinetmaximize((s5/usr/lib/python2.7/dist-packages/apt/progress/text.pyt_writeCs$N(t__name__t
__module__t__doc__tNoneRtTruetFalseR(((s5/usr/lib/python2.7/dist-packages/apt/progress/text.pyR;scBs/eZdZdd�Zdd�Zd�ZRS(s\Operation progress reporting.

    This closely resembles OpTextProgress in libapt-pkg.
    cCs-tj||�tjj|�d|_dS(Nt(RRRRtold_op(RR((s5/usr/lib/python2.7/dist-packages/apt/progress/text.pyR[scCsktjj||�|jr8|jr8|j|j�n|jd|j|jftt	�|j|_dS(s1Called periodically to update the user interface.s%s... %i%%
N(
RRtupdatetmajor_changeR%RtoptpercentR#R"(RR)((s5/usr/lib/python2.7/dist-packages/apt/progress/text.pyR&as
#cCsOtjj|�|jrB|jtd�d|jftt�nd|_dS(s,Called once an operation has been completed.s%c%s... Dones
R$N(RRtdoneR%RR
R"(R((s5/usr/lib/python2.7/dist-packages/apt/progress/text.pyR*js	)N(RRR R!RR&R*(((s5/usr/lib/python2.7/dist-packages/apt/progress/text.pyRUs	cBsbeZdZd
d�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�ZRS(s'AcquireProgress for the text interface.cCsEtj||�tjj|�d|_d|_td�|_dS(NiPi(	RRRRR!t_signalRtlongt_id(RR((s5/usr/lib/python2.7/dist-packages/apt/progress/text.pyRvs
		cCsHtjj|�tjtj|j�|_|j�td�|_dS(s�Start an Acquire progress.

        In this case, the function sets up a signal handler for SIGWINCH, i.e.
        window resize signals. And it also sets id to 1.
        iN(	RRtstarttsignaltSIGWINCHt_winchR+R,R-(R((s5/usr/lib/python2.7/dist-packages/apt/progress/text.pyR.~s
cGs�t|jd�r�tj|jj��r�ddl}ddl}ddl}|j|j|j	d�}|j
d|�\}}}}|d|_ndS(	s)Signal handler for window resize signals.tfilenoi����NiRthhhhis        (thasattrRtostisattyR2tfcntlttermioststructtioctlt
TIOCGWINSZtunpackR(RtdummyR7R8R9tbuftcol((s5/usr/lib/python2.7/dist-packages/apt/progress/text.pyR1�s*cCsctjj||�td�|j}|jjrR|dtj|jj�7}n|j	|�dS(s@Called when an item is update (e.g. not modified on the server).sHit s [%sB]N(
RRtims_hitR
tdescriptiontownertfilesizeR	tsize_to_strR(Rtitemtline((s5/usr/lib/python2.7/dist-packages/apt/progress/text.pyR@�s
 cCs}tjj||�|jj|jjkrH|jtd�|j�n1|jtd�|j�|jd|jj	�dS(sCalled when an item is failed.sIgn sErr s  %sN(
RRtfailRBtstatust	STAT_DONERR
RAt
error_text(RRE((s5/usr/lib/python2.7/dist-packages/apt/progress/text.pyRG�s
cCs�tjj||�|jjr#dS|j|j_|jd7_td�d|jj|jf}|jj	r�|dt
j|jj	�7}n|j|�dS(s/Called when some of the item's data is fetched.NisGet:s%s %ss [%sB](
RRtfetchRBtcompleteR-tidR
RARCR	RDR(RRERF((s5/usr/lib/python2.7/dist-packages/apt/progress/text.pyRK�s# c	Cs�tjj||�t|jd�rBtj|jj��rBtS|j	|j
dt|j|j
�}t}d|}d}|jr�tt|j|j	�|j�}dtj|j�tj|�f}nx�|jD]�}d}|jsO|jr�d|j}t|�t|�t|�|jkr6Pn||7}t}q�q�nt}|jjjr�|d|jjj|jjf7}n|d|jj7}|jjjr�|d	|jjj7}n|d
tj|j�7}|jr+|jjj r+|dtj|j�|jd|jf7}n|d7}t|�t|�t|�|jkrbPq�||7}q�W|s�|t!d
�7}n|jr�||jt|�t|�d|7}n|j"|t�tS(s�Periodically invoked while the Acquire process is underway.

        Return False if the user asked to cancel the whole Acquire process.R2gY@s%i%%R$s	 %sB/s %ss [%s]s [%i %ss [%ss %ss %sBs	/%sB %i%%t]s
 [Working]R(#RRtpulseR4RR5R6R2R"t
current_bytest
current_itemstfloatttotal_bytesttotal_itemsR#tcurrent_cpsR,R	RDttime_to_strtworkerstcurrent_itemRHRRRBRMt	shortdescRAtactive_subprocesstcurrent_sizet
total_sizeRLR
R(	RRBR)tshownttvaltendtetatworkertval((s5/usr/lib/python2.7/dist-packages/apt/progress/text.pyRO�s\
	
		
)
	
)	,cCs@tjj|||�|jtd�||f�t�dkS(s7Prompt the user to change the inserted removable media.sUMedia change: please insert the disc labeled
 '%s'
in the drive '%s' and press enter
tctC(RcRd(RRtmedia_changeRR
tinput(Rtmediumtdrive((s5/usr/lib/python2.7/dist-packages/apt/progress/text.pyRe�scCs�tjj|�|jtd�tj|j�tj|j	�tj|j
�fjd��ddl}|j|j
|j�dS(s/Invoked when the Acquire process stops running.sFetched %sB in %s (%sB/s)
s
i����N(RRtstopRR
R	RDt
fetched_bytesRVtelapsed_timeRUtrstripR/R0R+(RR/((s5/usr/lib/python2.7/dist-packages/apt/progress/text.pyRis N(
RRR R!RR.R1R@RGRKROReRi(((s5/usr/lib/python2.7/dist-packages/apt/progress/text.pyRss	
				
		E		cBs)eZdZd�Zd�Zd�ZRS(sText CD-ROM progress.cCsStjj|�|jtd�t�yttd��SWntk
rNdSXdS(s,Ask the user to provide a name for the disc.sBPlease provide a name for this Disc, such as 'Debian 2.1r1 Disk 1't:N(
RRtask_cdrom_nameRR
R#tstrRftKeyboardInterruptR!(R((s5/usr/lib/python2.7/dist-packages/apt/progress/text.pyRns
cCs3tjj|||�|r/|j|t�ndS(sSet the current progress.N(RRR&RR#(Rttexttcurrent((s5/usr/lib/python2.7/dist-packages/apt/progress/text.pyR&#scCsVtjj|�|jtd�t�ytt�dk�SWntk
rQtSXdS(s"Ask the user to change the CD-ROM.s1Please insert a Disc in the drive and press enterR$N(	RRtchange_cdromRR
R#tboolRfRp(R((s5/usr/lib/python2.7/dist-packages/apt/progress/text.pyRs*s
(RRR RnR&Rs(((s5/usr/lib/python2.7/dist-packages/apt/progress/text.pyRs		(R t
__future__RtioR5R/RttypesttypingRRRtImportErrorR	tapt.progressRt__all__tversion_infotmajort	raw_inputRftintR,R
tobjectRRRR(((s5/usr/lib/python2.7/dist-packages/apt/progress/text.pyt<module>s4
			�