mirror of
https://github.com/mbirth/tcl_ota_check.git
synced 2024-11-09 22:06:47 +00:00
Use more Python.
This commit is contained in:
parent
e56599d3b4
commit
f721d2acef
@ -30,9 +30,9 @@ print(" OK")
|
||||
|
||||
print("List of latest FULL firmware by PRD:")
|
||||
|
||||
for prd in prds:
|
||||
model = prds[prd]["variant"]
|
||||
lastver = prds[prd]["last_full"]
|
||||
for prd, variant in prds.items():
|
||||
model = variant["variant"]
|
||||
lastver = variant["last_full"]
|
||||
if prdcheck in prd:
|
||||
try:
|
||||
fc.reset_session()
|
||||
@ -41,7 +41,7 @@ for prd in prds:
|
||||
curef, fv, tv, fw_id, fileid, fn, fsize, fhash = fc.parse_check(check_xml)
|
||||
txt_tv = tv
|
||||
if tv != lastver:
|
||||
txt_tv = tcllib.ANSI_CYAN + txt_tv + tcllib.ANSI_RESET + " (OTA: {})".format(prds[prd]["last_ota"])
|
||||
txt_tv = tcllib.ANSI_CYAN + txt_tv + tcllib.ANSI_RESET + " (OTA: {})".format(variant["last_ota"])
|
||||
print("{}: {} {} ({})".format(prd, txt_tv, fhash, model))
|
||||
except RequestException as e:
|
||||
print("{}: {}".format(prd, str(e)))
|
||||
|
@ -35,9 +35,9 @@ print(" OK")
|
||||
|
||||
print("List of latest OTA firmware{} by PRD:".format(force_ver_text))
|
||||
|
||||
for prd in prds:
|
||||
model = prds[prd]["variant"]
|
||||
lastver = prds[prd]["last_ota"]
|
||||
for prd, variant in prds.items():
|
||||
model = variant["variant"]
|
||||
lastver = variant["last_ota"]
|
||||
if args.forcever is not None:
|
||||
lastver = args.forcever
|
||||
if prdcheck in prd:
|
||||
@ -47,7 +47,7 @@ for prd in prds:
|
||||
fc.fv = lastver
|
||||
check_xml = fc.do_check(max_tries=20)
|
||||
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(prds[prd]["last_full"])
|
||||
versioninfo = tcllib.ANSI_CYAN_DARK + fv + tcllib.ANSI_RESET + " ⇨ " + tcllib.ANSI_CYAN + tv + tcllib.ANSI_RESET + " (FULL: {})".format(variant["last_full"])
|
||||
print("{}: {} {} ({})".format(prd, versioninfo, fhash, model))
|
||||
except RequestException as e:
|
||||
print("{} ({}): {}".format(prd, lastver, str(e)))
|
||||
|
Loading…
Reference in New Issue
Block a user