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]["status"] = "progress"
if status == "started":
state[name_major]["started"] = 1
state[name_major]["done"] = 0 state[name_major]["done"] = 0
else:
state[name_major]["started"] = 0 state[name_major]["started"] = 0
state[name_major]["done"] = 1 for tile in state[name_major]:
else: # Filter status of name_major
state[name_major][status] += 1 if tile != "done" and tile != "started" and tile != "pending" and tile != "status" and tile != "rebuild":
if status == "done": state[name_major][state[name_major][tile]["status"]] += 1
state[name_major]["started"] -= 1
if state[name_major]["done"] == 100: if state[name_major]["done"] == 100:
state[name_major]["status"] = "done" state[name_major]["status"] = "done"
elif state[name_major]["started"] > 0:
state[name_major]["status"] = "started"
else:
state[name_major]["status"] = "pending"
try: try:
with open(sfile, 'w') as f: with open(sfile, 'w') as f: