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

Output old version for FULL search as well. Also: colour coding - OTA=yellow, FULL=cyan

This commit is contained in:
Markus Birth 2017-12-20 00:00:28 +01:00
parent 9d8e0e8ff1
commit 99b4fd7912
Signed by: mbirth
GPG Key ID: A9928D7A098C3A9A
2 changed files with 6 additions and 2 deletions

6
tclcheck_allfull.py Executable file → Normal file
View File

@ -41,7 +41,11 @@ for prd, variant in prds.items():
curef, fv, tv, fw_id, fileid, fn, fsize, fhash = fc.parse_check(check_xml) curef, fv, tv, fw_id, fileid, fn, fsize, fhash = fc.parse_check(check_xml)
txt_tv = tv txt_tv = tv
if tv != lastver: if tv != lastver:
txt_tv = tcllib.ANSI_CYAN + txt_tv + tcllib.ANSI_RESET + " (OTA: {})".format(variant["last_ota"]) txt_tv = "{} (old: {} / OTA: {})".format(
tcllib.ANSI_CYAN + txt_tv + tcllib.ANSI_RESET,
tcllib.ANSI_CYAN_DARK + variant["last_full"] + tcllib.ANSI_RESET,
variant["last_ota"]
)
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)))

2
tclcheck_allota.py Executable file → Normal file
View File

@ -48,7 +48,7 @@ for prd, variant in prds.items():
fc.fv = lastver fc.fv = lastver
check_xml = fc.do_check(max_tries=20) check_xml = fc.do_check(max_tries=20)
curef, fv, tv, fw_id, fileid, fn, fsize, fhash = fc.parse_check(check_xml) curef, fv, tv, fw_id, fileid, fn, fsize, fhash = fc.parse_check(check_xml)
versioninfo = tcllib.ANSI_CYAN_DARK + fv + tcllib.ANSI_RESET + "" + tcllib.ANSI_CYAN + tv + tcllib.ANSI_RESET + " (FULL: {})".format(variant["last_full"]) versioninfo = tcllib.ANSI_YELLOW_DARK + fv + tcllib.ANSI_RESET + "" + tcllib.ANSI_YELLOW + tv + tcllib.ANSI_RESET + " (FULL: {})".format(variant["last_full"])
print("{}: {} {} ({})".format(prd, versioninfo, fhash, model)) print("{}: {} {} ({})".format(prd, versioninfo, fhash, model))
except RequestException as e: except RequestException as e:
print("{} ({}): {}".format(prd, lastver, str(e))) print("{} ({}): {}".format(prd, lastver, str(e)))