1
0
mirror of https://github.com/mbirth/tcl_ota_check.git synced 2024-11-10 06:16:46 +00: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, tcllib.ANSI_CYAN_DARK + variant["last_full"] + tcllib.ANSI_RESET,
variant["last_ota"] variant["last_ota"]
) )
else:
fc.delete_last_dump()
print("{}: {} {} ({})".format(prd, txt_tv, fhash, model)) print("{}: {} {} ({})".format(prd, txt_tv, fhash, model))
except RequestException as e: except RequestException as e:
print("{}: {}".format(prd, str(e))) print("{}: {}".format(prd, str(e)))

View File

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