Skip to content

Commit c2a73b1

Browse files
committed
Merge branch 'release/4.1.1'
2 parents 6b79ecc + 5ac9a2c commit c2a73b1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

progressbar/__about__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
long running operations.
2020
'''.strip().split())
2121
__email__ = 'wolph@wol.ph'
22-
__version__ = '4.1.0'
22+
__version__ = '4.1.1'
2323
__license__ = 'BSD'
2424
__copyright__ = 'Copyright 2015 Rick van Hattem (Wolph)'
2525
__url__ = 'https://github.com/WoLpH/python-progressbar'

progressbar/widgets.py

+6
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,9 @@ class Timer(FormatLabel, TimeSensitiveWidgetBase):
272272
'''WidgetBase which displays the elapsed seconds.'''
273273

274274
def __init__(self, format='Elapsed Time: %(elapsed)s', **kwargs):
275+
if '%s' in format and '%(elapsed)s' not in format:
276+
format = format.replace('%s', '%(elapsed)s')
277+
275278
FormatLabel.__init__(self, format=format, **kwargs)
276279
TimeSensitiveWidgetBase.__init__(self, **kwargs)
277280

@@ -373,6 +376,9 @@ def __init__(
373376
format_NA='ETA: N/A',
374377
**kwargs):
375378

379+
if '%s' in format and '%(eta)s' not in format:
380+
format = format.replace('%s', '%(eta)s')
381+
376382
Timer.__init__(self, **kwargs)
377383
self.format_not_started = format_not_started
378384
self.format_finished = format_finished

0 commit comments

Comments
 (0)