mirror of
https://github.com/mbirth/tcl_ota_check.git
synced 2024-11-10 06:16:46 +00:00
Output some stats when scanning for new PRDs.
This commit is contained in:
parent
095ba8cebb
commit
fb830f8dd1
@ -7,6 +7,8 @@ import collections
|
|||||||
import tcllib
|
import tcllib
|
||||||
from requests.exceptions import RequestException, Timeout
|
from requests.exceptions import RequestException, Timeout
|
||||||
|
|
||||||
|
tcllib.make_escapes_work()
|
||||||
|
|
||||||
fc = tcllib.FotaCheck()
|
fc = tcllib.FotaCheck()
|
||||||
fc.serid = "3531510"
|
fc.serid = "3531510"
|
||||||
fc.fv = "AAA000"
|
fc.fv = "AAA000"
|
||||||
@ -27,11 +29,20 @@ with open("prds.txt", "r") as afile:
|
|||||||
for key, value in prdc.items():
|
for key, value in prdc.items():
|
||||||
prddict[key].append(value)
|
prddict[key].append(value)
|
||||||
|
|
||||||
for center in prddict.keys():
|
|
||||||
|
|
||||||
|
for center in sorted(prddict.keys()):
|
||||||
tails = [int(i) for i in prddict[center]]
|
tails = [int(i) for i in prddict[center]]
|
||||||
|
total_count = 1000 - len(tails)
|
||||||
|
done_count = 0
|
||||||
|
print("Checking {} variant codes for model {}.".format(total_count, center))
|
||||||
for j in range(0, 1000):
|
for j in range(0, 1000):
|
||||||
if j not in tails:
|
if j in tails:
|
||||||
curef = "PRD-{}-{}".format(center, str(j).rjust(3, "0"))
|
continue
|
||||||
|
curef = "PRD-{}-{:03}".format(center, j)
|
||||||
|
done_count += 1
|
||||||
|
print("Checking {} ({}/{})".format(curef, done_count, total_count))
|
||||||
|
print(tcllib.ANSI_UP_DEL, end="")
|
||||||
try:
|
try:
|
||||||
fc.reset_session()
|
fc.reset_session()
|
||||||
fc.curef = curef
|
fc.curef = curef
|
||||||
@ -41,3 +52,5 @@ for center in prddict.keys():
|
|||||||
print("{}: {} {}".format(curef, txt_tv, fhash))
|
print("{}: {} {}".format(curef, txt_tv, fhash))
|
||||||
except (SystemExit, RequestException, Timeout) as e:
|
except (SystemExit, RequestException, Timeout) as e:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
print("Scan complete.")
|
||||||
|
Loading…
Reference in New Issue
Block a user