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:
parent
9ab7314662
commit
2c506fb4e1
@ -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)))
|
||||||
|
@ -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():
|
||||||
|
Loading…
Reference in New Issue
Block a user