1
0
mirror of https://github.com/mbirth/tcl_ota_check.git synced 2024-09-19 22:33:25 +01:00

simplify filtering

This commit is contained in:
thurask 2017-10-10 16:16:27 -04:00
parent 8982bb6ac0
commit e8bdb1a743
No known key found for this signature in database
GPG Key ID: A6CCCDEA29795048

View File

@ -51,20 +51,14 @@ if args.tocheck is not None:
prddict[args.tocheck] = []
for center in sorted(prddict.keys()):
alltails = [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 alltails]
while True:
if floor in alltails:
floor += 1
else:
break
tails = [int(i) for i in prddict[center]]
safes = [g for g in range(floor, ceiling) if g not in tails]
if floor in tails:
floor = safes[0]
total_count = len(safes)
done_count = 0
print("Checking {} variant codes for model {}.".format(total_count, center))
for j in range(floor, ceiling):
if j in tails:
continue
for j in safes:
curef = "PRD-{}-{:03}".format(center, j)
done_count += 1
print("Checking {} ({}/{})".format(curef, done_count, total_count))