use correct last progress bar state value
This commit is contained in:
parent
5328ed105e
commit
0151ce8040
1 changed files with 6 additions and 6 deletions
|
@ -361,7 +361,7 @@ class Advanced(Basic):
|
||||||
self.get_or_create_bar(bar_name, label, d['units'], d['total'], True)
|
self.get_or_create_bar(bar_name, label, d['units'], d['total'], True)
|
||||||
else:
|
else:
|
||||||
if d['done'][0] != -1:
|
if d['done'][0] != -1:
|
||||||
bar.update(d['done'][0] - bar.last_print_n)
|
bar.update(d['done'][0] - bar.n)
|
||||||
if d['done'][0] == -1 or d['done'][0] == bar.total:
|
if d['done'][0] == -1 or d['done'][0] == bar.total:
|
||||||
bar.close()
|
bar.close()
|
||||||
|
|
||||||
|
@ -397,9 +397,9 @@ class Advanced(Basic):
|
||||||
if d['done'][0] != -1:
|
if d['done'][0] != -1:
|
||||||
main_bar_name = f"{name[:name.rindex('.')]}.main"
|
main_bar_name = f"{name[:name.rindex('.')]}.main"
|
||||||
if len(d['done']) > 1:
|
if len(d['done']) > 1:
|
||||||
diff = tuple(a-b for a, b in zip(d['done'], (bar.last_print_n, bar.last_print_n2)))
|
diff = tuple(a-b for a, b in zip(d['done'], (bar.n, bar.n2)))
|
||||||
else:
|
else:
|
||||||
diff = d['done'][0] - bar.last_print_n
|
diff = d['done'][0] - bar.n
|
||||||
if main_bar_name != name:
|
if main_bar_name != name:
|
||||||
main_bar = self.bars.get(main_bar_name)
|
main_bar = self.bars.get(main_bar_name)
|
||||||
if main_bar.unit == bar.unit:
|
if main_bar.unit == bar.unit:
|
||||||
|
@ -433,14 +433,14 @@ class Advanced(Basic):
|
||||||
bar.reset(d['total'])
|
bar.reset(d['total'])
|
||||||
return
|
return
|
||||||
|
|
||||||
diff = d['step']-bar.last_print_n
|
diff = d['step']-bar.n
|
||||||
bar.update(diff)
|
bar.update(diff)
|
||||||
if event.endswith("save") and d['step'] == d['total']:
|
if event.endswith("save") and d['step'] == d['total']:
|
||||||
self.block_savers -= 1
|
self.block_savers -= 1
|
||||||
bar.close()
|
bar.close()
|
||||||
|
|
||||||
total_bar.update(diff)
|
total_bar.update(diff)
|
||||||
if total_bar.total == total_bar.last_print_n:
|
if total_bar.total == total_bar.n:
|
||||||
if total_bar.desc.endswith('txs saved'):
|
if total_bar.desc.endswith('txs saved'):
|
||||||
total_bar.desc = "├─ txs saved"
|
total_bar.desc = "├─ txs saved"
|
||||||
total_bar.refresh()
|
total_bar.refresh()
|
||||||
|
@ -457,7 +457,7 @@ class Advanced(Basic):
|
||||||
.replace('signatures', 'sigs')
|
.replace('signatures', 'sigs')
|
||||||
)
|
)
|
||||||
bar = self.get_or_create_bar(e, f"├─ {name:>12}", d['unit'], d['total'], True)
|
bar = self.get_or_create_bar(e, f"├─ {name:>12}", d['unit'], d['total'], True)
|
||||||
diff = d['step']-bar.last_print_n
|
diff = d['step']-bar.n
|
||||||
bar.update(diff)
|
bar.update(diff)
|
||||||
#if d['step'] == d['total']:
|
#if d['step'] == d['total']:
|
||||||
#bar.close()
|
#bar.close()
|
||||||
|
|
Loading…
Reference in a new issue