Allow to specify from-version for tclcheck_allota.py. Updated README.
This commit is contained in:
Regular → Executable
+11
-5
@@ -3,6 +3,7 @@
|
||||
|
||||
# pylint: disable=C0111,C0326
|
||||
|
||||
import sys
|
||||
import tcllib
|
||||
from requests.exceptions import RequestException, Timeout
|
||||
|
||||
@@ -14,7 +15,13 @@ fc.serid = "3531510"
|
||||
fc.mode = fc.MODE_OTA
|
||||
fc.cltp = 10
|
||||
|
||||
print("List of latest OTA firmware by PRD:".format(fc.fv))
|
||||
force_ver = False
|
||||
force_ver_text = ""
|
||||
if len(sys.argv) > 1:
|
||||
force_ver = sys.argv[1]
|
||||
force_ver_text = " from {}".format(force_ver)
|
||||
|
||||
print("List of latest OTA firmware{} by PRD:".format(force_ver_text))
|
||||
|
||||
with open("prds.txt", "r") as afile:
|
||||
prdx = afile.read()
|
||||
@@ -22,16 +29,15 @@ with open("prds.txt", "r") as afile:
|
||||
|
||||
while len(prds) > 0:
|
||||
prd, lastver, model = prds[0].split(" ", 2)
|
||||
if force_ver != False:
|
||||
lastver = force_ver
|
||||
try:
|
||||
fc.reset_session()
|
||||
fc.curef = prd
|
||||
fc.fv = lastver
|
||||
check_xml = fc.do_check()
|
||||
curef, fv, tv, fw_id, fileid, fn, fsize, fhash = fc.parse_check(check_xml)
|
||||
txt_tv = tv
|
||||
if fc.mode == fc.MODE_OTA:
|
||||
txt_tv = "{} ⇨ {}".format(fv, tv)
|
||||
print("{}: {} {} ({})".format(prd, txt_tv, fhash, model))
|
||||
print("{}: {} ⇨ {} {} ({})".format(prd, fv, tv, fhash, model))
|
||||
prds.pop(0)
|
||||
except Timeout as e:
|
||||
print("{} failed. (Connection timed out.)".format(prd))
|
||||
|
||||
Reference in New Issue
Block a user