mirror of
https://github.com/mbirth/tcl_ota_check.git
synced 2024-11-10 06:16:46 +00:00
simplify filtering
This commit is contained in:
parent
8982bb6ac0
commit
e8bdb1a743
@ -51,20 +51,14 @@ if args.tocheck is not None:
|
|||||||
prddict[args.tocheck] = []
|
prddict[args.tocheck] = []
|
||||||
|
|
||||||
for center in sorted(prddict.keys()):
|
for center in sorted(prddict.keys()):
|
||||||
alltails = [int(i) for i in prddict[center]]
|
tails = [int(i) for i in prddict[center]]
|
||||||
tails = [h for h in alltails if floor < h < ceiling]
|
safes = [g for g in range(floor, ceiling) if g not in tails]
|
||||||
safes = [g for g in range(floor, ceiling) if g not in alltails]
|
if floor in tails:
|
||||||
while True:
|
floor = safes[0]
|
||||||
if floor in alltails:
|
|
||||||
floor += 1
|
|
||||||
else:
|
|
||||||
break
|
|
||||||
total_count = len(safes)
|
total_count = len(safes)
|
||||||
done_count = 0
|
done_count = 0
|
||||||
print("Checking {} variant codes for model {}.".format(total_count, center))
|
print("Checking {} variant codes for model {}.".format(total_count, center))
|
||||||
for j in range(floor, ceiling):
|
for j in safes:
|
||||||
if j in tails:
|
|
||||||
continue
|
|
||||||
curef = "PRD-{}-{:03}".format(center, j)
|
curef = "PRD-{}-{:03}".format(center, j)
|
||||||
done_count += 1
|
done_count += 1
|
||||||
print("Checking {} ({}/{})".format(curef, done_count, total_count))
|
print("Checking {} ({}/{})".format(curef, done_count, total_count))
|
||||||
|
Loading…
Reference in New Issue
Block a user