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] = [] 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))