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