MINI SHELL

Server : Apache/2.2.2 (Fedora)
System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686
User : apache ( 48)
PHP Version : 5.2.9
Disable Function : NONE
Directory :  /proc/self/root/usr/lib/python2.4/site-packages/urlgrabber/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/usr/lib/python2.4/site-packages/urlgrabber/progress.pyc
mò
+VCc@sÄdkZdkZdkZdkZdfd„ƒYZdefd„ƒYZeZdefd„ƒYZdfd„ƒYZd	efd
„ƒYZ	dfd„ƒYZ
d
d„Zd
dd„ZdS(Nt	BaseMetercBshtZd„Zddddddd„Zdd„Zdd„Zdd„Zdd„Zdd„Z	RS(NcCsad|_d|_d|_d|_d|_d|_d|_d|_	d|_
tƒ|_dS(Nf0.29999999999999999i(
tselft
update_periodtNonetfilenameturltbasenamettexttsizet
start_timetlast_amount_readtlast_update_timet
RateEstimatortre(R((t7/usr/lib/python2.4/site-packages/urlgrabber/progress.pyt__init__s									cCs­||_||_||_||_||_|dj	ot|ƒd|_n|djot
i
ƒ}n||_|ii
||ƒd|_||_|i|ƒdS(NtBi(RRRRRRRt
format_numbertfsizetnowttimeR	R
tstartR
Rt	_do_start(RRRRRRR((RR)s					

			cCsdS(N((RR((RR;scCs||djotiƒ}n||i|ijp|io9|ii||ƒ||_	||_|i
||ƒndS(N(RRRRRRR
tupdatetamount_readR
t
_do_update(RRR((RR>s
"		cCsdS(N((RRR((RRIscCsV|djotiƒ}n|ii||ƒ||_||_|i	||ƒdS(N(
RRRRR
RRR
Rt_do_end(RRR((RtendLs
		cCsdS(N((RRR((RRSs(
t__name__t
__module__RRRRRRRR(((RRs	
t	TextMetercBs/tZeid„Zdd„Zdd„ZRS(NcCsti|ƒ||_dS(N(RRRtfo(RR((RRWs
cCsð|iiƒ}t|ƒ}
t|ƒ}|i	dj	o
|i	}n
|i}|idjod|||
f}n\|iiƒ}t|ƒ}|iiƒ}dtd|ƒ}	d||d|	||f}|ii|ƒ|iiƒdS(Ns
%-60.60s    %5sB %s t=is(
%-25.25s %3i%% |%-25.25s| %5sB %8s ETA id(RR
telapsed_timetetimetformat_timetfetimeRRtfreadRRRRtouttremaining_timetrtimetfrtimet
fraction_readtfractinttbarRtwritetflush(RRRR(R+RR%R"R)R-R$R&((RR[s
	cCs¶t|iiƒƒ}t|ƒ}|idj	o
|i}n
|i
}|idjod|||f}n$dd}d|d|||f}|ii|dƒ|iiƒdS(Ns
%-60.60s    %5sB %s R is(
%-25.25s %3i%% |%-25.25s| %5sB %8s     ids
(R#RR
R!t
total_timeRRt
total_sizeRRRRR&R-RR.R/(RRRR0R-R1RR&((RRss
	
(RRtsyststderrRRRR(((RRVstMultiFileHelpercBsAtZd„Zd„Zd„Zd„Zdd„Zd„ZRS(NcCsti|ƒ||_dS(N(RRRtmaster(RR5((RR‡s
cCs|ii||ƒdS(N(RR5tstart_meterR(RR((RR‹scCs|ii||ƒdS(N(RR5tupdate_meterR(RRR((RRŽscCs?t||iƒ|_t|iƒ|_|ii	||ƒdS(N(
R#RRR	tftotal_timeRR
tftotal_sizeR5t	end_meter(RRR((RR’scCs|ii|||ƒdS(N(RR5t
failure_metertmessageR(RR<R((Rtfailure—scCs|ii||ƒdS(N(RR5t
message_meterR<(RR<((RR<šs(	RRRRRRRR=R<(((RR4†s				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_lockRRtnumfilestfinished_filestfailed_filest
open_filesR1tfailed_sizeR	tfinished_file_sizeRRR
(R((RRŸs												cCs’|djotiƒ}n||_d|_d|_d|_||_d|_	||_
d|_||_|i
i||ƒ|i|ƒdS(Ni(RRRRERRFRGRHR1RIR	RJRR
RR(RRER1R((RR°s
									cCsdS(N((RR((RR¾scCs.|djotiƒ}n|i|ƒdS(N(RRRRR(RR((RRÁs
cCsdS(N((RR((RRÅscCs|iiƒdS(N(RRDtacquire(R((RtlockÈscCs|iiƒdS(N(RRDtrelease(R((RtunlockÉscCs#|i|ƒ}|ii|ƒ|S(N(RthelperclasstnewmeterR@tappend(RRP((RtnewMeterÍscCs|ii|ƒdS(N(RR@tremovetmeter(RRT((RtremoveMeterÒscCs‰||ijotdƒ‚n|iiƒz7||ijo#|ii|ƒ|id7_nWd|ii	ƒX|i
||ƒdS(Nsattempt to use orphaned meteri(RTRR@t
ValueErrorRDRKRARQRHRMt_do_start_meterR(RRTR((RR6×s
cCsdS(N((RRTR((RRWãscCs|||ijotdƒ‚n||i|ijp|io6|ii|i	ƒ|ƒ||_|i
||ƒndS(Nsattempt to use orphaned meter(RTRR@RVRRRR
Rt_amount_readt_do_update_meter(RRTR((RR7æs"	cCsdS(N((RRTR((RRYïscCs°||ijotdƒ‚n|iiƒz^y|ii|ƒWntj
onX|id8_|i	d7_	|i
|i7_
Wd|iiƒX|i
||ƒdS(Nsattempt to use orphaned meteri(RTRR@RVRDRKRARSRHRFRJR
RMt
_do_end_meterR(RRTR((RR:òs
cCsdS(N((RRTR((RRZscCsÚ||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(RTRR@RVRDRKRARSRHRGRRIRRMt_do_failure_meterR<R(RRTR<R((RR;s 

cCsdS(N((RRTR<R((RR[scCsdS(N((RRTR<((RR>scCs.|i}x|iD]}||i7}qW|S(N(RRJttotRAtmR
(RR]R\((RRXs
	
(RRR4RORRRRRRRLRNRRRUR6RWR7RYR:RZR;R[R>RX(((RR?s(																	tTextMultiFileMetercBsDtZeid„Zd„Zd„Zd„Zd„Zd„Z	RS(NcCs||_ti|ƒdS(N(RRR?R(RR((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.48999999999999999iRs%-79.79ss
("RRDRKtformatRFtdfREttftfloattpfR
R
tddR1ttdR*tpdR!tdtR'trtRtttRtfddtftdR#tfdttfttR&RR.R/RM(RRTRR&RhRmRcRkRfRaReRdR_R`RgRjRlRi((RRY)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.9sRisB/ss%-79.79ss
s
(RRDRKR_RTRtfnR
RRRR
R!tetR#tfettfrateR&RR.RMRYR(RRTRRqR_RRpRoR&RnR((RRZDs
		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 %stus%-79stFAILEDis
s
is  (RRDRKR_RTRRnttypeR<t
splitlinesR&RR.R]RMRYR(RRTR<RR_R]RnR&((RR[Us 
	%
"cCs&|iiƒzWd|iiƒXdS(N(RRDRKRM(RRTR<((RR>ds

cCsS|id|ƒ|iiƒz!|iidƒ|iiƒWd|ii	ƒXdS(Ns
(
RRYRRRDRKRR.R/RM(RR((RRks
(
RRR2R3RRYRZR[R>R(((RR^#s				RcBsqtZdd„Zddd„Zdd„Zd„Zd„Zd„Zd„Z	d	„Z
d
„Zdd„ZRS(
Nf5.0cCs
||_dS(N(t	timescaleR(RRv((RRxscCsN|djotiƒ}n||_||_||_d|_d|_dS(Ni(	RRRttotalRR	RR
tave_rate(RRwR((RR{s
				cCsž|djotiƒ}n|djo#||_d|_d|_dSn||i}||i}||_||_|i
|||i|iƒ|_dS(Ni(RRRRRRR
Rxt	time_difft	read_difft_temporal_rolling_aveRv(RRRRzRy((RRƒs

			

		cCs|iS(s/get the average transfer rate (in bytes/second)N(RRx(R((Rtaverage_rate—scCs|i|iS(sEthe time between the start of the transfer and the most recent updateN(RRR	(R((RR!›scCs3|ip|iodSn|i|i|iS(sestimated time remainingN(RRxRwRR
(R((RR'ŸscCsH|idjodSn-|idjodSnt|iƒ|iSdS(s[the fraction of the data that has been read
        (can be None for unknown transfer size)if1.0N(RRwRRbR
(R((RR*¤s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(RyRvtepsilonRt_rolling_aveRztlast_ave(RRyRzRRvR}((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(RzRytrecent_ratetZeroDivisionErrorRRR}(RRyRzRR}R€((RR~¹s

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(RhR,tmathtlogR	tshiftRb(RRhR	R„((Rt_round_remaining_timeÊs
&
(
RRRRRRR|R!R'R*R{R~R…(((RRws							icCs“|djp
|djo|odSqdSn_t|ƒ}|d}|d}|o)|d}|d}d|||fSnd||fSdS(Nis--:--:--s--:--i<s%02i:%02i:%02is	%02i:%02i(tsecondsRt	use_hoursR,tminutesthours(R†R‡R‰Rˆ((RR#Þs



t c		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 numbersRrtktMtGtTtPtEtZtYf1000.0f1024.0içiils%i%s%sf9.9499999999999993s%.1f%s%ss%.0f%s%sN(tsymbolstSItsteptthreshtdepthtlent	max_depthtnumberRtR_Rbtspace(	RšR”R›R—R_R“R–R•R™((RRís$!


2


(
R2RR‚RBRRttext_progress_meterR4R?R^RR#R(
RRBR^R?RR#R2R4RœRRR‚R((Rt?s				;.†Tg

Anon7 - 2021