Skip to content

Commit

Permalink
Merge branch 'release/4.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
wolph committed Oct 18, 2022
2 parents 6b79ecc + 5ac9a2c commit c2a73b1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion progressbar/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
long running operations.
'''.strip().split())
__email__ = 'wolph@wol.ph'
__version__ = '4.1.0'
__version__ = '4.1.1'
__license__ = 'BSD'
__copyright__ = 'Copyright 2015 Rick van Hattem (Wolph)'
__url__ = 'https://github.com/WoLpH/python-progressbar'
6 changes: 6 additions & 0 deletions progressbar/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ class Timer(FormatLabel, TimeSensitiveWidgetBase):
'''WidgetBase which displays the elapsed seconds.'''

def __init__(self, format='Elapsed Time: %(elapsed)s', **kwargs):
if '%s' in format and '%(elapsed)s' not in format:
format = format.replace('%s', '%(elapsed)s')

FormatLabel.__init__(self, format=format, **kwargs)
TimeSensitiveWidgetBase.__init__(self, **kwargs)

Expand Down Expand Up @@ -373,6 +376,9 @@ def __init__(
format_NA='ETA: N/A',
**kwargs):

if '%s' in format and '%(eta)s' not in format:
format = format.replace('%s', '%(eta)s')

Timer.__init__(self, **kwargs)
self.format_not_started = format_not_started
self.format_finished = format_finished
Expand Down

0 comments on commit c2a73b1

Please sign in to comment.