cave-stat data tuck

This commit is contained in:
Martinez 2017-11-20 23:08:43 +01:00
parent a42e2c5947
commit 863cbe05ca

View file

@ -19,6 +19,7 @@ def cave_stat():
if "--x-of-y" in cmdline:
position = [c for c in cmdline if " of " in c][0]
pos, total, failed = [safe_int(a) for a in re.findall("(\d+) of (\d+)(?:, (\d+) failed)?", position)[0]]
done = pos - 1
if "--destination" in cmdline:
action = "Installing"
@ -30,7 +31,7 @@ def cave_stat():
lines = [
"<B>**<.> %s <W>%s<.>" %(action, atom),
" - <G>%s of %s <g>done<.> (%.01f %% remaining)" %(pos, total, 100 - 100 * int(pos) / int(total))
" - <G>%s of %s <g>done<.> (%.01f %% remaining)" %(done, total, 100 - 100 * int(done) / int(total))
]
if failed: