#NEWLINE# def __call__( self , count , blocksize , totalsize ) : #NEWLINE# #INDENT# if ( totalsize <= 0 ) : #NEWLINE# #INDENT# if ( self . pbar is None ) : #NEWLINE# #INDENT# self . pbar = progressbar . ProgressBar ( widgets = [ self . filename , ' ' , progressbar . BouncingBar ( ) , ' ' , progressbar . FileTransferSpeed ( ) ] , maxval = progressbar . UnknownLength ) #NEWLINE# self . pbar . start ( ) #NEWLINE# #UNINDENT# self . pbar . update ( max ( ( count * blocksize ) , 1 ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . pbar is None ) : #NEWLINE# #INDENT# self . pbar = progressbar . ProgressBar ( widgets = [ self . filename , ' ' , progressbar . Percentage ( ) , ' ' , progressbar . Bar ( ) , ' ' , progressbar . ETA ( ) , ' ' , progressbar . FileTransferSpeed ( ) ] , maxval = max ( totalsize , 1 ) ) #NEWLINE# self . pbar . start ( ) #NEWLINE# #UNINDENT# self . pbar . update ( max ( min ( ( count * blocksize ) , totalsize ) , 1 ) )