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/yum/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/21573/root/usr/lib/python2.4/site-packages/yum/callbacks.pyo
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	*	

Anon7 - 2021