MOON
Server: Apache/2.2.34 (Unix) mod_ssl/2.2.34 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 FrontPage/5.0.2.2635
System: Linux server.asjudinet.com 2.6.32-042stab141.3 #1 SMP Fri Nov 15 22:45:34 MSK 2019 i686
User: asjudine (504)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: //proc/3/root/usr/lib/python2.4/site-packages/yum/callbacks.pyc
mō
üüPc@sĒdkZdklZlZlZdZdZdZdZdZ	hed<ed<ed	<e	d
<Z
dfd„ƒYZd
fd„ƒYZdefd„ƒYZ
dS(N(s	BaseMetersformat_times
format_numberi
iiii(sDownloading PackagessCheck Package SignaturessRunning Test TransactionsRunning TransactiontProcessTransBaseCallbackcBstZd„Zdd„ZRS(NcCstidƒ|_dS(Ns)yum.verbose.ProcessTrasactionBaseCallback(tloggingt	getLoggertselftlogger(R((t1/usr/lib/python2.4/site-packages/yum/callbacks.pyt__init__'scCs/|tiƒjo|iit|ƒndS(N(tstatetPT_MESSAGEStkeysRRtinfo(RRtdata((Rtevent*s(t__name__t
__module__RtNoneR(((RR%s	tProcessTransNoOutputCallbackcBstZd„Zdd„ZRS(NcCsdS(N((R((RR/scCsdS(N((RRR((RR2s(R
RRRR(((RR.s	tDownloadBaseCallbackcBsYtZdZd„Zed„Zed„Zed„Zed„Zd„Z	d„Z
RS(s  
    This is class is a base class to use by implement a download progress
    handler to be used with YumBase.repos.setProgressBar.
    
    Example:
    
    from yum.callbacks import DownloadBaseCallback
    
    class MyDownloadCallback(  DownloadBaseCallback ):

        def updateProgress(self,name,frac,fread,ftime):
            '''
            Update the progressbar
            @param name: filename
            @param frac: Progress fracment (0 -> 1)
            @param fread: formated string containing BytesRead
            @param ftime : formated string containing remaining or elapsed time
            '''
            pct = int( frac*100 )
            print " %s : %s " % (name,pct)


    if __name__ == '__main__':
        my = YumBase()
        my.doConfigSetup()
        dnlcb = MyDownloadCallback()
        my.repos.repos.setProgressBar( dnlcb )
        for pkg in my.pkgSack:
            print pkg.name

    cCsti|ƒd|_dS(Nt(t	BaseMeterRRttotSize(R((RRVs
cCsti|||ƒdS(N(RtupdateRtamount_readtnow(RRR((RRZscCsL|iƒ}|i|dddƒ|idj	ot|iƒ|_ndS(Nf0.0R(Rt_getNametnametupdateProgresstsizeRt
format_numberR(RRR((Rt	_do_start]sc
Cs§t|ƒ}|iƒ}|idjo;|ii	ƒ}t|ƒ}d}|i||||ƒnA|iiƒ}t|ƒ}	|iiƒ}|i||||	ƒdS(Nf0.0(RRtfreadRRRRRtretelapsed_timetetimetformat_timetfetimetfracRtremaining_timetrtimetfrtimet
fraction_read(
RRRR&R$RR#RR!R'((Rt
_do_updatecscCsGt|iiƒƒ}t|ƒ}|iƒ}|i
|d||ƒdS(Nf1.0(R"RRR t
total_timeRRt
total_sizeRRR(RRRR*RR+((Rt_do_endtscCs@|io)t|iƒtdƒjo
|i}n
|i}|S(s>
        Get the name of the package being downloaded
        RN(RttextttypeRtbasename(RR((RRzs
&
	cCsdS(s
         Update the progressbar (Overload in child class)
        @param name: filename
        @param frac: Progress fracment (0 -> 1)
        @param fread: formated string containing BytesRead
        @param ftime : formated string containing remaining or elapsed time
        N((RRR$Rtftime((RR„s(R
Rt__doc__RRRRR)R,RR(((RR5s		
(Rturlgrabber.progressRR"RtPT_DOWNLOADtPT_DOWNLOAD_PKGStPT_GPGCHECKt
PT_TEST_TRANStPT_TRANSACTIONRRRR(
R6RRRR"R7R5RRRR3RR4((Rt?s	*