Progress Bar¶
New in version 0.4.0.
Module to make an ASCII progress bar.
- class lsl.common.progress.DownloadBar(max=100, span=70, sym='=', print_percent=True, color=None)¶
Modified version of the ProgressBarPlus class that has a crude bandwidth estimator. At the end of the download the total file size (max) is displayed instead of the average rate.
- Example Usage:
>>> import sys >>> from progess import DownloadBar >>> db = DownloadBar() >>> db.inc() >>> sys.stdout.write(db.show()) >>> sys.stdout.flush()
Note
The timing feature is only active when the inc()/dec() functions are called.
New in version 2.0.2.
- show()¶
Build a string representation of the download bar and return it.
- class lsl.common.progress.ProgressBar(max=100, span=70, sym='=', print_percent=True, color=None)¶
Object to make a ASCII progress bar for use with various long- run tasks.
- Example Usage:
>>> import sys >>> from progess import ProgressBar >>> pb = ProgressBar() >>> pb.inc() >>> sys.stdout.write(pb.show()) >>> sys.stdout.flush()
- dec(amount=1)¶
Decrement the progress bar’s internal counter by some amount. The default is one.
- inc(amount=1)¶
Increment the progress bar’s internal counter by some amount. The default is one.
- show()¶
Build a string representation of the progress bar and return it.
- class lsl.common.progress.ProgressBarPlus(max=100, span=70, sym='=', print_percent=True, color=None)¶
Extended version of the ProgressBar class that has a crude time estimator.
- Example Usage:
>>> import sys >>> from progess import ProgressBarPlus >>> pb = ProgressBarPlus() >>> pb.inc() >>> sys.stdout.write(pb.show()) >>> sys.stdout.flush()
Note
The timing feature is only active when the inc()/dec() functions are called.
New in version 0.6.4.
- show()¶
Build a string representation of the progress bar and return it.
- startTimer()¶
Initialize the timer.