Class SlowBar: ETA estimate with minute accuracy

This commit is contained in:
Jylpah committed 2020-02-15 15:26:06 +02:00
1 parent 6ecddb3d95
commit 15dddcf1b7
1 file changed
+7 -2
+7 -2
View File
@@ -312,10 +312,15 @@ def bld_dict_hierarcy(d : dict, key : str, value) -> dict:
## -----------------------------------------------------------
class SlowBar(IncrementalBar):
suffix = '%(index)d/%(max)d %(percent)d%% ETA %(remaining_hours).1f hours'
suffix = '%(index)d/%(max)d %(percent)d%% ETA %(remaining_hours).0f h %(remaining_mins).0f mins'
@property
def remaining_hours(self):
return Decimal(self.eta / 3600).quantize(Decimal('1.0'))
return self.eta // 3600
@property
def remaining_mins(self):
return (self.eta - (self.eta // 3600)*3600) // 60
## -----------------------------------------------------------