Better progress logging

Signed-off-by: fly <merspieler@airmail.cc>
This commit is contained in:
fly 2019-12-28 14:00:13 +00:00
parent 81b5740e1a
commit 4344adec6a

View file

@ -118,20 +118,18 @@ try:
if not name in state[name_major]: if not name in state[name_major]:
state[name_major][name] = {} state[name_major][name] = {}
state[name_major][name]["status"] = status state[name_major][name]["status"] = status
if not "status" in state[name_major]: state[name_major]["done"] = 0
state[name_major]["status"] = "progress" state[name_major]["started"] = 0
if status == "started": for tile in state[name_major]:
state[name_major]["started"] = 1 # Filter status of name_major
state[name_major]["done"] = 0 if tile != "done" and tile != "started" and tile != "pending" and tile != "status" and tile != "rebuild":
else: state[name_major][state[name_major][tile]["status"]] += 1
state[name_major]["started"] = 0 if state[name_major]["done"] == 100:
state[name_major]["done"] = 1 state[name_major]["status"] = "done"
elif state[name_major]["started"] > 0:
state[name_major]["status"] = "started"
else: else:
state[name_major][status] += 1 state[name_major]["status"] = "pending"
if status == "done":
state[name_major]["started"] -= 1
if state[name_major]["done"] == 100:
state[name_major]["status"] = "done"
try: try:
with open(sfile, 'w') as f: with open(sfile, 'w') as f: