mirror of
https://github.com/verigak/progress.git
synced 2025-12-10 12:15:34 +00:00
Update documentation
This commit is contained in:
33
README.rst
33
README.rst
@@ -44,17 +44,20 @@ This will produce a bar like the following: ::
|
|||||||
|
|
||||||
You can use a number of template arguments in ``message`` and ``suffix``:
|
You can use a number of template arguments in ``message`` and ``suffix``:
|
||||||
|
|
||||||
========= =============================
|
========== ================================
|
||||||
Name Value
|
Name Value
|
||||||
========= =============================
|
========== ================================
|
||||||
index current value
|
index current value
|
||||||
max maximum value
|
max maximum value
|
||||||
remaining max - index
|
remaining max - index
|
||||||
progress index / max
|
progress index / max
|
||||||
percent progress * 100
|
percent progress * 100
|
||||||
avg rolling average time per item (in seconds)
|
avg simple moving average time per item (in seconds)
|
||||||
eta avg * remaining
|
elapsed elapsed time in seconds
|
||||||
========= =============================
|
elapsed_td elapsed as a timedelta (useful for printing as a string)
|
||||||
|
eta avg * remaining
|
||||||
|
eta_td eta as a timedelta (useful for printing as a string)
|
||||||
|
========== ================================
|
||||||
|
|
||||||
Instead of passing all configuration options on instatiation, you can create
|
Instead of passing all configuration options on instatiation, you can create
|
||||||
your custom subclass. ::
|
your custom subclass. ::
|
||||||
@@ -64,6 +67,14 @@ your custom subclass. ::
|
|||||||
fill = '*'
|
fill = '*'
|
||||||
suffix = '%(percent).1f%% - %(eta)ds'
|
suffix = '%(percent).1f%% - %(eta)ds'
|
||||||
|
|
||||||
|
You can also override any of the arguments or create your own. ::
|
||||||
|
|
||||||
|
class SlowBar(Bar):
|
||||||
|
suffix = '%(remaining_hours)d hours remaining'
|
||||||
|
@property
|
||||||
|
def remaining_hours(self):
|
||||||
|
return self.eta // 3600
|
||||||
|
|
||||||
|
|
||||||
Spinners
|
Spinners
|
||||||
========
|
========
|
||||||
|
|||||||
Reference in New Issue
Block a user