Bases: object
A class that displays either a ProgressBar or Spinner depending on whether the total size of the operation is known or not.
It is designed to be used with the with statement:
if file.has_length():
length = file.get_length()
else:
length = None
bytes_read = 0
with ProgressBarOrSpinner(length) as bar:
while file.read(blocksize):
bytes_read += blocksize
bar.update(bytes_read)
Parameters: | total : int or None
msg : str
color : str, optional
file : writable file-like object, optional
|
---|
Methods Summary
update(value) | Update the progress bar to the given value (out of the total given to the constructor. |
Methods Documentation
Update the progress bar to the given value (out of the total given to the constructor.