1
0
mirror of https://github.com/mbirth/tcl_ota_check.git synced 2024-09-19 22:33:25 +01:00

Only keep FULL logs if version is new.

This commit is contained in:
Markus Birth 2018-01-18 00:47:27 +01:00
parent 9ab7314662
commit 2c506fb4e1
Signed by: mbirth
GPG Key ID: A9928D7A098C3A9A
2 changed files with 9 additions and 0 deletions

View File

@ -45,6 +45,8 @@ for prd, variant in prds.items():
tcllib.ANSI_CYAN_DARK + variant["last_full"] + tcllib.ANSI_RESET,
variant["last_ota"]
)
else:
fc.delete_last_dump()
print("{}: {} {} ({})".format(prd, txt_tv, fhash, model))
except RequestException as e:
print("{}: {}".format(prd, str(e)))

View File

@ -94,6 +94,7 @@ class FotaCheck:
self.master_servers_weights = [3] * len(self.master_servers)
self.check_time_sum = 3
self.check_time_count = 1
self.last_dump_filename = None
self.reset_session()
def reset_session(self):
@ -153,6 +154,12 @@ class FotaCheck:
raise
with open(outfile, "w", encoding="utf-8") as f:
f.write(data)
self.last_dump_filename = outfile
def delete_last_dump(self):
if self.last_dump_filename:
os.unlink(self.last_dump_filename)
self.last_dump_filename = None
@staticmethod
def write_info_if_dumps_found():