File tree 2 files changed +7
-1
lines changed
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 19
19
long running operations.
20
20
''' .strip ().split ())
21
21
__email__ = 'wolph@wol.ph'
22
- __version__ = '4.1.0 '
22
+ __version__ = '4.1.1 '
23
23
__license__ = 'BSD'
24
24
__copyright__ = 'Copyright 2015 Rick van Hattem (Wolph)'
25
25
__url__ = 'https://github.com/WoLpH/python-progressbar'
Original file line number Diff line number Diff line change @@ -272,6 +272,9 @@ class Timer(FormatLabel, TimeSensitiveWidgetBase):
272
272
'''WidgetBase which displays the elapsed seconds.'''
273
273
274
274
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
+
275
278
FormatLabel .__init__ (self , format = format , ** kwargs )
276
279
TimeSensitiveWidgetBase .__init__ (self , ** kwargs )
277
280
@@ -373,6 +376,9 @@ def __init__(
373
376
format_NA = 'ETA: N/A' ,
374
377
** kwargs ):
375
378
379
+ if '%s' in format and '%(eta)s' not in format :
380
+ format = format .replace ('%s' , '%(eta)s' )
381
+
376
382
Timer .__init__ (self , ** kwargs )
377
383
self .format_not_started = format_not_started
378
384
self .format_finished = format_finished
You can’t perform that action at this time.
0 commit comments