mirror of
https://github.com/mbirth/tcl_ota_check.git
synced 2024-11-09 22:06:47 +00:00
add new syntax option to findprd2
This commit is contained in:
parent
acf55d8e23
commit
42a8c5653b
@ -24,6 +24,7 @@ dp = argparser.DefaultParser(__file__, dpdesc)
|
|||||||
dp.add_argument("floor", nargs="?", help="Model number to start with", type=int, default=63116)
|
dp.add_argument("floor", nargs="?", help="Model number to start with", type=int, default=63116)
|
||||||
dp.add_argument("ceiling", nargs="?", help="Model number to end with", type=int, default=99999)
|
dp.add_argument("ceiling", nargs="?", help="Model number to end with", type=int, default=99999)
|
||||||
dp.add_argument("-l", "--local", help="Force using local database", dest="local", action="store_true", default=False)
|
dp.add_argument("-l", "--local", help="Force using local database", dest="local", action="store_true", default=False)
|
||||||
|
dp.add_argument("-k2", "--key2", help="V2 syntax", dest="key2mode", action="store_true", default=False)
|
||||||
args = dp.parse_args(sys.argv[1:])
|
args = dp.parse_args(sys.argv[1:])
|
||||||
|
|
||||||
floor = args.floor
|
floor = args.floor
|
||||||
@ -38,7 +39,7 @@ print(" OK")
|
|||||||
|
|
||||||
print("Valid PRDs not already in database:")
|
print("Valid PRDs not already in database:")
|
||||||
|
|
||||||
known_centers = set(int(x.replace("PRD-", "").split("-")[0]) for x in prd_db)
|
known_centers = set(int(x.replace("PRD-", "").replace("APBI-PRD", "")[0:5]) for x in prd_db)
|
||||||
scan_list = set(range(floor, ceiling))
|
scan_list = set(range(floor, ceiling))
|
||||||
|
|
||||||
to_scan = scan_list - known_centers
|
to_scan = scan_list - known_centers
|
||||||
@ -52,6 +53,9 @@ runner.max_tries = 20
|
|||||||
|
|
||||||
for center in to_scan:
|
for center in to_scan:
|
||||||
for j in SCAN_VARIANTS:
|
for j in SCAN_VARIANTS:
|
||||||
|
if args.key2mode:
|
||||||
|
curef = "APBI-PRD{:05}{:3}".format(center, j)
|
||||||
|
else:
|
||||||
curef = "PRD-{:05}-{:3}".format(center, j)
|
curef = "PRD-{:05}-{:3}".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