@@ -265,25 +265,25 @@ def _copyfileobj_readinto(fsrc, fdst, callback, length=BUFSIZE):
265265 callback (n )
266266
267267class Progress :
268- def __init__ (self , logger , title , num_f , num_b ): #initialization
268+ def __init__ (self , logger , title , total_files , total_bytes ): #initialization
269269 self .logger = logger
270270 self .title = title
271- self .num_f = num_f
272- self .num_b = num_b
273- self .cur_f = 0
271+ self .total_files = total_files
272+ self .total_bytes = total_bytes
273+ self .current_file = 0
274274 self .tqdm = None
275275
276276 def update_file (self , name ):
277277 # Delay the initialization of tqdm to prevent console spam
278278 if self .logger .getEffectiveLevel () == INFO and USE_TQDM and self .tqdm is None :
279- self .tqdm = tqdm (total = self .num_b , unit = 'B' , unit_scale = True , unit_divisor = 1024 )
279+ self .tqdm = tqdm (total = self .total_bytes , unit = 'B' , unit_scale = True , unit_divisor = 1024 )
280280
281- self .cur_f += 1
281+ self .current_file += 1
282282 if self .logger .getEffectiveLevel () == INFO :
283283 if self .tqdm is not None :
284- self .tqdm .set_description (f'{ name } [{ self .cur_f } / { self .num_f } ]' )
284+ self .tqdm .set_description (f'{ name } [{ self .current_file } / { self .total_files } ]' )
285285 else :
286- sys .stderr .write ('\r {}: {}/{}' .format (self .title , self .cur_f , self .num_f ))
286+ sys .stderr .write ('\r {}: {}/{}' .format (self .title , self .current_file , self .total_files ))
287287 sys .stderr .flush ()
288288
289289 def update (self , bytes_add ):
0 commit comments