Update documentation

This commit is contained in:
Giorgos Verigakis
2013-11-28 13:49:12 +08:00
parent 120b3e53b1
commit a5981103cf

View File

@@ -44,17 +44,20 @@ This will produce a bar like the following: ::
You can use a number of template arguments in ``message`` and ``suffix``:
========= =============================
Name Value
========= =============================
index current value
max maximum value
remaining max - index
progress index / max
percent progress * 100
avg rolling average time per item (in seconds)
eta avg * remaining
========= =============================
========== ================================
Name Value
========== ================================
index current value
max maximum value
remaining max - index
progress index / max
percent progress * 100
avg simple moving average time per item (in seconds)
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
your custom subclass. ::
@@ -64,6 +67,14 @@ your custom subclass. ::
fill = '*'
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
========