mirror of
https://github.com/mbirth/tcl_ota_check.git
synced 2024-11-09 22:06:47 +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
|
||||
from requests.exceptions import RequestException, Timeout
|
||||
|
||||
tcllib.make_escapes_work()
|
||||
|
||||
fc = tcllib.FotaCheck()
|
||||
fc.serid = "3531510"
|
||||
fc.fv = "AAA000"
|
||||
@ -27,11 +29,20 @@ with open("prds.txt", "r") as afile:
|
||||
for key, value in prdc.items():
|
||||
prddict[key].append(value)
|
||||
|
||||
for center in prddict.keys():
|
||||
|
||||
|
||||
for center in sorted(prddict.keys()):
|
||||
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):
|
||||
if j not in tails:
|
||||
curef = "PRD-{}-{}".format(center, str(j).rjust(3, "0"))
|
||||
if j in tails:
|
||||
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:
|
||||
fc.reset_session()
|
||||
fc.curef = curef
|
||||
@ -41,3 +52,5 @@ for center in prddict.keys():
|
||||
print("{}: {} {}".format(curef, txt_tv, fhash))
|
||||
except (SystemExit, RequestException, Timeout) as e:
|
||||
continue
|
||||
|
||||
print("Scan complete.")
|
||||
|
Loading…
Reference in New Issue
Block a user