KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /proc/21573/root/usr/lib/python2.4/site-packages/urlgrabber/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/21573/root/usr/lib/python2.4/site-packages/urlgrabber/progress.pyo
mò
AÝrMc@sdkZdkZdkZdkZdkZdkZdkZdd„Zda	da
ddd„Zdfd„ƒYZdfd„ƒYZ
d	ad	ad	d
„Zde
fd„ƒYZeZd
e
fd„ƒYZdfd„ƒYZdefd„ƒYZdfd„ƒYZd	d„Zd	dd„Zd„ZedjoºeeiƒdjoFeiddjo2eddddddddddƒneddd d	dd<d=d>ƒed%dd d	dd?d@dAdBƒ	ed&d'd d(ddCdDdEdFƒ	ed)d*d d	ddGdHdIƒed+d,d d-ddJdKdLƒed.d/d d0ddMdNdOƒed1d2d d	ddPƒed3d4d d5ddQƒed6d7d d8ddRƒed9d d d	ddSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddeƒndS(fNicCscyQd}ti|ti|ƒ}tid|ƒd}|djodSn|SWndSnXdS(s Get the real terminal width tabcdefghthhhhiiiPN(	tbuftfcntltioctltfdttermiost
TIOCGWINSZtstructtunpacktret(RR
R((t7/usr/lib/python2.4/site-packages/urlgrabber/progress.pytterminal_widths
f1.0cCsDtiƒ}tdjp|t|jot|ƒa|antS(s6 Get the real terminal width, but cache it for a bit. N(ttimetnowt_term_width_valtNonet_term_width_lastt
cache_timeoutRR(RRR((Rtterminal_width_cached-s
tTerminalLinecBsMtZdZdeddd„Zd„Zdd„Zed„Zd	„ZRS(
sB Help create dynamic progress bars, uses terminal_width_cached(). iif1.0cCs\|djo
|}n||_t||ƒ|_|i|jo
||_nt	|_
dS(N(tbeg_lenRtmin_resttselft_min_lenRRRt_llentFalset_fin(RRRRR((Rt__init__;s

	
cCs|i|iS(s Usable length for elements. N(RRR(R((Rt__len__DsicCs'|i|jodSn|i||S(sw After a fixed length, split the rest of the line length among
            a number of different elements (default=2). iN(RRtfixedtelements(RRR((Rt
rest_splitHscCsh|djot|ƒ}nt|ƒ|jo
t|_n|iodSn|it|ƒ8_|S(s‹ If there is room left in the line, above min_len, add element.
            Note that as soon as one add fails all the rest will fail too. tN(tfull_lenRtlentelementRtTrueRR(RR$R"((RtaddOs


cCs|iS(sA Current rest of line, same as .rest_split(fixed=0, elements=1). N(RR(R((Rtrest]s(	t__name__t
__module__t__doc__RRRR R&R'(((RR8s		t	BaseMetercBshtZd„Zddddddd„Zdd„Zdd„Zdd„Zdd„Zdd„Z	RS(NcCsad|_d|_d|_d|_d|_d|_d|_d|_	d|_
tƒ|_dS(Nf0.29999999999999999i(
Rt
update_periodRtfilenameturltbasenamettexttsizet
start_timetlast_amount_readtlast_update_timet
RateEstimatortre(R((RRbs									cCs­||_||_||_||_||_|dj	ot|ƒd|_n|djot
i
ƒ}n||_|ii
||ƒd|_||_|i|ƒdS(NtBi(R-RR.R/R0R1Rt
format_numbertfsizeRR
R2R6tstartR3R4t	_do_start(RR-R.R/R1RR0((RR:os					

			cCsdS(N((RR((RR;scCs||djotiƒ}n||i|ijp|io9|ii||ƒ||_	||_|i
||ƒndS(N(RRR
RR4R,R6tupdatetamount_readR3t
_do_update(RR=R((RR<„s
"		cCsdS(N((RR=R((RR>scCsV|djotiƒ}n|ii||ƒ||_||_|i	||ƒdS(N(
RRR
RR6R<R=R3R4t_do_end(RR=R((Rtend’s
		cCsdS(N((RR=R((RR?™s(
R(R)RRR:R;R<R>R@R?(((RR+as	
icCs|a|adS(N(R1t_text_meter_total_sizet
downloadedt_text_meter_sofar_size(R1RB((Rttext_meter_total_size¡st	TextMetercBs/tZeid„Zdd„Zdd„ZRS(NcCsti|ƒ||_dS(N(R+RRtfo(RRF((RR×s
cCs¦|iiƒ}t|ƒ}
t|ƒ}|i	dj	o
|i	}n
|i}t|iiƒƒ}d}tot|}|dt}ntddddƒ}
|
id|ƒ}|idjoh|
id|
ƒ}|
iddƒ}|
id|ƒ}d	|
iƒ|
iƒ|||||f}	nY|iiƒ}t|ƒ}|iiƒ}|
id|ƒ}|
id
ƒ}|djo
d}n |
id|d
t"dƒƒ}|
id|dƒ}|
id|ƒ}d|
i$dddƒ}dt&||ƒ}||t&||ƒdjo|d7}n|
id|||fƒ}d|
iƒ|
iƒ||||||||f
}	|i)i*|	ƒ|i)i+ƒdS(Nidiis | %5sBs %9st is %5sB/ss%-*.*s%s%s%s%s
s ETA R!s (%i%%)R"s (100%)s %2i%%it=f0.5t-s	 [%-*.*s]s%-*.*s%s%s%s%s%s%s%s
(,RR6telapsed_timetetimetformat_timetfetimeR8R=tfreadR0RR/taverage_ratetave_dlt
sofar_sizeRARCtsofar_pcRttlR&tui_sizeR1tui_timetui_endtui_rateR'touttremaining_timetrtimetfrtimet
fraction_readtfractui_sofar_pcR#tui_pcR tblentinttbartui_barRFtwritetflush(RR=RRUR0RNRWR`RTRXRMRcRKRSR_R[R]RQR^RZRbRVRPRR((RR>ÛsJ
	
/


4cCsOt|iiƒƒ}t|ƒ}|idj	o
|i}n
|i
}tdƒ}	|	i
d|ƒ}|	i
d|ƒ}|idj	o
||ij}|o|	i
dƒ}
n|	i
ddƒ}
d|	iƒ|	iƒ||||
f}|ii|ƒ|iiƒ|odSntot|7anttjodadandS(	Nis | %5sBs %9ss ... RGis
%-*.*s%s%s%s
i(RLRR6RJt
total_timeR8R=t
total_sizeR0RR/RRSR&RTRUR1tnot_doneRVR'RXRFRdReRARC(RR=RRfRURgR0RhRTRSRVRX((RR?s0
	(

(R(R)tsyststderrRRR>R?(((RREÖs6tMultiFileHelpercBsAtZd„Zd„Zd„Zd„Zdd„Zd„ZRS(NcCsti|ƒ||_dS(N(R+RRtmaster(RRl((RR8s
cCs|ii||ƒdS(N(RRltstart_meterR(RR((RR;<scCs|ii||ƒdS(N(RRltupdate_meterR(RR=R((RR>?scCs?t||iƒ|_t|iƒ|_|ii	||ƒdS(N(
RLRRR2tftotal_timeR8R3tftotal_sizeRlt	end_meter(RR=R((RR?CscCs|ii|||ƒdS(N(RRlt
failure_metertmessageR(RRsR((RtfailureHscCs|ii||ƒdS(N(RRlt
message_meterRs(RRs((RRsKs(	R(R)RR;R>R?RRtRs(((RRk7s				tMultiFileMetercBsÅtZeZd„Zdddd„Zd„Zdd„Zd„Z	d„Z
d„Zd„Zd	„Z
d
„Zd„Zd„Zd
„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(NcCs‹g|_g|_tiƒ|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_tƒ|_dS(Nf0.29999999999999999i(Rtmeterstin_progress_meterstthreadt
allocate_lockt_lockR,Rtnumfilestfinished_filestfailed_filest
open_filesRgtfailed_sizeR2tfinished_file_sizeR4R5R6(R((RRPs												cCs’|djotiƒ}n||_d|_d|_d|_||_d|_	||_
d|_||_|i
i||ƒ|i|ƒdS(Ni(RRR
R|RR}R~RRgR€R2RR4R6R:R;(RR|RgR((RR:as
									cCsdS(N((RR((RR;oscCs.|djotiƒ}n|i|ƒdS(N(RRR
RR?(RR((RR@rs
cCsdS(N((RR((RR?vscCs|iiƒdS(N(RR{tacquire(R((RtlockyscCs|iiƒdS(N(RR{trelease(R((RtunlockzscCs#|i|ƒ}|ii|ƒ|S(N(RthelperclasstnewmeterRwtappend(RR‡((RtnewMeter~scCs|ii|ƒdS(N(RRwtremovetmeter(RR‹((RtremoveMeterƒscCs‰||ijotdƒ‚n|iiƒz7||ijo#|ii|ƒ|id7_nWd|ii	ƒX|i
||ƒdS(Nsattempt to use orphaned meteri(R‹RRwt
ValueErrorR{R‚RxRˆRR„t_do_start_meterR(RR‹R((RRmˆs
cCsdS(N((RR‹R((RRŽ”scCs|||ijotdƒ‚n||i|ijp|io6|ii|i	ƒ|ƒ||_|i
||ƒndS(Nsattempt to use orphaned meter(R‹RRwRRR4R,R6R<t_amount_readt_do_update_meter(RR‹R((RRn—s"	cCsdS(N((RR‹R((RR scCs°||ijotdƒ‚n|iiƒz^y|ii|ƒWntj
onX|id8_|i	d7_	|i
|i7_
Wd|iiƒX|i
||ƒdS(Nsattempt to use orphaned meteri(R‹RRwRR{R‚RxRŠRR}RR3R„t
_do_end_meterR(RR‹R((RRq£s
cCsdS(N((RR‹R((RR‘±scCsÚ||ijotdƒ‚n|iiƒz…y|ii|ƒWntj
onX|id8_|i	d7_	|i
o&|idj	o|i|i
7_n
d|_Wd|ii
ƒX|i|||ƒdS(Nsattempt to use orphaned meteri(R‹RRwRR{R‚RxRŠRR~R1R€RR„t_do_failure_meterRsR(RR‹RsR((RRr´s 

cCsdS(N((RR‹RsR((RR’ÅscCsdS(N((RR‹Rs((RRuÈscCs.|i}x|iD]}||i7}qW|S(N(RRttotRxtmR3(RR”R“((RRÍs
	
(R(R)RkR†RRR:R;R@R?RƒR…R‰RŒRmRŽRnRRqR‘RrR’RuR(((RRvNs(																	tTextMultiFileMetercBsDtZeid„Zd„Zd„Zd„Zd„Zd„Z	RS(NcCs||_ti|ƒdS(N(RFRRvR(RRF((RRÕs	c
CsT|iiƒz2d}|i}
|ipd}	dt|
ƒ|	d}|i
i}|i
}
d|i
iƒpdd}|i
iƒ}|i
iƒ}|djo
d}n||}t|ƒd}t|
ƒd}t|dƒ}t|dƒ}d||
|	||||||f}|iid|ƒ|ii ƒWd|ii!ƒXdS(	NsDfiles: %3i/%-3i %3i%%   data: %6.6s/%-6.6s %3i%%   time: %8.8s/%8.8siidf0.48999999999999999iR7s%-79.79ss
("RR{R‚tformatR}tdfR|ttftfloattpfR6R3tddRgttdR\tpdRJtdtRYtrtRtttR8tfddtftdRLtfdttfttRXRFRdReR„(RR‹RRXRŸR¤RšR¢RR˜RœR›R–R—RžR¡R£R ((RRÚs.
		


&cCsÂ|iiƒzd}|i}	|i}
t	|
ƒd}|iiƒ}t|dƒ}t	|
|ƒd}d||	|||f}|iid|dƒWd|iiƒX|i||ƒdS(Ns %-30.30s %6.6s    %8.8s    %9.9sR7isB/ss%-79.79ss
s
(RR{R‚R–R‹R/tfnR3R1R8R9R6RJtetRLtfettfrateRXRFRdR„RR(RR‹RR¨R–R9R§R¦RXR¥R1((RR‘õs
		cCsõ|iiƒzÐd}|i}t|ƒtdƒtdƒfjo|i	ƒ}n|p
dg}nd||d|dpdf}|iid|dƒx*|d	D]}|iid
|dƒq­W|iiƒWd|i||ƒXdS(Ns%-30.30s %6.6s %sR!us%-79stFAILEDis
s
is  (RR{R‚R–R‹R/R¥ttypeRst
splitlinesRXRFRdR”R„RR(RR‹RsRR–R”R¥RX((RR’s 
	%
"cCs&|iiƒzWd|iiƒXdS(N(RR{R‚R„(RR‹Rs((RRus

cCsS|id|ƒ|iiƒz!|iidƒ|iiƒWd|ii	ƒXdS(Ns
(
RRRRR{R‚RFRdReR„(RR((RR?s
(
R(R)RiRjRRR‘R’RuR?(((RR•Ôs				R5cBsqtZdd„Zddd„Zdd„Zd„Zd„Zd„Zd„Z	d	„Z
d
„Zdd„ZRS(
Nf5.0cCs
||_dS(N(t	timescaleR(RR¬((RR)scCsN|djotiƒ}n||_||_||_d|_d|_dS(Ni(	RRR
ttotalRR2R4R3tave_rate(RR­R((RR:,s
				cCs¬|djotiƒ}n|djo#||_d|_d|_dSn||i}||i}|io.||_|i
|||i|iƒ|_n||_dS(Ni(RRR
R=RR4R3R®t	time_difft	read_difft_temporal_rolling_aveR¬(RR=RR°R¯((RR<4s

			


	%cCs|iS(s/get the average transfer rate (in bytes/second)N(RR®(R((RROJscCs|i|iS(sEthe time between the start of the transfer and the most recent updateN(RR4R2(R((RRJNscCs3|ip|iodSn|i|i|iS(sestimated time remainingN(RR®R­RR3(R((RRYRscCsH|idjodSn-|idjodSnt|iƒ|iSdS(s[the fraction of the data that has been read
        (can be None for unknown transfer size)if1.0N(RR­RR™R3(R((RR\WscCs7||}|djo
d}n|i||||ƒS(sqa temporal rolling average performs smooth averaging even when
        updates come at irregular intervals.  This is performed by scaling
        the "epsilon" according to the time since the last update.
        Specifically, epsilon = time_diff / timescale

        As a general rule, the average will take on a completely new value
        after 'timescale' seconds.if1.0N(R¯R¬tepsilonRt_rolling_aveR°tlast_ave(RR¯R°R´R¬R²((RR±`s



cCshy||}Wntj
o
d}nX|djo|Sn|djo|Sn||d||S(sKperform a "rolling average" iteration
        a rolling average "folds" new data into an existing average with
        some weight, epsilon.  epsilon must be between 0.0 and 1.0 (inclusive)
        a value of 0.0 means only the old value (initial value) counts,
        and a value of 1.0 means only the newest value is considered.iN(R°R¯trecent_ratetZeroDivisionErrorRR´R²(RR¯R°R´R²Rµ((RR³ls

f15.0cCst|djodSntti||ƒtidƒƒ}t|ƒ}|djo|Sntt|ƒ|?|>ƒS(s—round the remaining time, depending on its size
        If rt is between n*start_time and (n+1)*start_time round downward
        to the nearest multiple of n (for any counting number n).
        If rt < start_time, round down to the nearest 1.
        For example (for start_time = 15.0):
         2.7  -> 2.0
         25.2 -> 25.0
         26.4 -> 26.0
         35.3 -> 34.0
         63.6 -> 60.0
        if0.0iN(RŸRatmathtlogR2tshiftR™(RRŸR2R¹((Rt_round_remaining_time}s
&
(
R(R)RRR:R<RORJRYR\R±R³Rº(((RR5(s							cCs®|djp
|djo|odSqªdSnz|tdƒjodSn_t|ƒ}|d}|d}|o)|d}|d}d|||fSnd||fSdS(	Nis--:--:--s--:--tinftInfinitei<s%02i:%02i:%02is	%02i:%02i(tsecondsRt	use_hoursR™Ratminutesthours(R½R¾RÀR¿((RRL‘s



RGc		Csddddddddd	g	}|o
d
}nd}d}d
}t|ƒd}x3||jo%||jo|d}||}qWWt|ƒtdƒjpt|ƒtdƒjo
d}n|djo
d}nd}|t
|pd
ƒ|||fS(s4Turn numbers into human-readable metric-like numbersR!tktMtGtTtPtEtZtYf1000.0f1024.0içiils%i%s%sf9.9499999999999993s%.1f%s%ss%.0f%s%sN(tsymbolstSItsteptthreshtdepthR#t	max_depthtnumberRªR–R™tspace(	RÏRÊRÐRÍR–RÉRÌRËRÎ((RR8¢s$!


2


cGsÁtƒ}	d|||f}|	i|d|||d|ƒ|}d}
xe|D]]\}}|
d7}
xD|||
t|ƒjo(||7}|	i|ƒti|ƒqhWqOW|	i|ƒdS(Ns(%d/%d): %ss"http://www.example.com/path/to/fn/R0ii(REttmtcurR“R¥R0R:R1tbegtnumtofftargstinctdelayR#R<R
tsleepR@(R¥RÒR“RÓR1RÖRÔR0RØRÑRÕR×((Rt_tstÉs	 


t__main__iR­ièi'i@Bssm-1.0.0-1.fc8.i386.rpmi
f0.20000000000000001f0.10000000000000001idf0.25ss-1.0.1-1.fc8.i386.rpmsm-1.0.1-2.fc8.i386.rpmiiˆs1large-file-name-Foo-11.8.7-4.5.6.1.fc8.x86_64.rpmis2large-file-name-Foo2-11.8.7-4.5.6.2.fc8.x86_64.rpmii!¡s2large-file-name-Foo3-11.8.7-4.5.6.3.fc8.x86_64.rpmii²qs2large-file-name-Foo4-10.8.7-4.5.6.1.fc8.x86_64.rpmis2large-file-name-Foo5-10.8.7-4.5.6.2.fc8.x86_64.rpmii‰s2large-file-name-Foo6-10.8.7-4.5.6.3.fc8.x86_64.rpmi	iNs1large-file-name-Foox-9.8.7-4.5.6.1.fc8.x86_64.rpmf0.5i †(i
f0.20000000000000001(i
f0.10000000000000001(idf0.25(i
f0.20000000000000001(idf0.10000000000000001(idf0.10000000000000001(idf0.25(i
f0.20000000000000001(idf0.10000000000000001(idf0.10000000000000001(idf0.25(ièf0.20000000000000001(ièf0.10000000000000001(i'f0.10000000000000001(ièf0.20000000000000001(ièf0.10000000000000001(i'f0.10000000000000001(ièf0.20000000000000001(ièf0.10000000000000001(i'f0.10000000000000001(idf0.10000000000000001(idf0.10000000000000001(if0.10000000000000001(i
f0.5(i †f0.10000000000000001(i'f0.10000000000000001(i'f0.10000000000000001(i'f0.10000000000000001(i †f0.10000000000000001(i'f0.10000000000000001(i'f0.10000000000000001(i'f0.10000000000000001(i †f0.10000000000000001(i'f0.10000000000000001(i'f0.10000000000000001(i'f0.10000000000000001(i †f0.10000000000000001(i'f0.10000000000000001(i'f0.10000000000000001(i'f0.10000000000000001(i †f0.10000000000000001(if0.10000000000000001(RiR
R·RyRRRRRRRRRR+RARCRDREttext_progress_meterRkRvR•R5RLR8RÚR(R#targv(RERLRDRRÚRRÜRR·RRvR8RRiR5R+RyR•RkR
R((Rt?sh							
)>5_†Ti'	
*2



	

Anon7 - 2021