Tryag File Manager
Home
-
Turbo Force
Current Path :
/
usr
/
lib
/
python2.4
/
site-packages
/
yum
/
Upload File :
New :
File
Dir
//usr/lib/python2.4/site-packages/yum/callbacks.pyo
mò •F»Oc @ sª d k Z d k l Z l Z l Z d Z d Z d Z d Z d Z h e d <e d <e d <e d <Z d f d „ ƒ YZ d f d „ ƒ YZ d e f d „ ƒ YZ d S( N( s BaseMeters format_times format_numberi i i i i( s Downloading Packagess Check Package Signaturess Running Test Transactions Running Transactiont ProcessTransBaseCallbackc B s t Z d „ Z d d „ Z RS( Nc C s t i d ƒ | _ d S( Ns) yum.verbose.ProcessTrasactionBaseCallback( t loggingt getLoggert selft logger( R ( ( t1 /usr/lib/python2.4/site-packages/yum/callbacks.pyt __init__' s c C s/ | t i ƒ j o | i i t | ƒ n d S( N( t statet PT_MESSAGESt keysR R t info( R R t data( ( R t event* s ( t __name__t __module__R t NoneR ( ( ( R R % s t ProcessTransNoOutputCallbackc B s t Z d „ Z d d „ Z RS( Nc C s d S( N( ( R ( ( R R / s c C s d S( N( ( R R R ( ( R R 2 s ( R R R R R ( ( ( R R . s t DownloadBaseCallbackc B sY t Z d Z d „ Z e d „ Z e d „ Z e d „ Z e d „ Z d „ 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 c C s t i | ƒ d | _ d S( Nt ( t BaseMeterR R t totSize( R ( ( R R V s c C s t i | | | ƒ d S( N( R t updateR t amount_readt now( R R R ( ( R R Z s c C sL | i ƒ } | i | d d d ƒ | i d j o t | i ƒ | _ n d S( Nf0.0R ( R t _getNamet namet updateProgresst sizeR t format_numberR ( R R R ( ( R t _do_start] s c C s§ t | ƒ } | i ƒ } | i d j o; | i i ƒ } t | ƒ } d } | i | | | | ƒ nA | i i ƒ } t | ƒ } | i i ƒ } | i | | | | ƒ d S( Nf0.0( R R t freadR R R R R t ret elapsed_timet etimet format_timet fetimet fracR t remaining_timet rtimet frtimet fraction_read( R R R R&