From c45c59aa62d1350ec096ab8723e82eb465cdfe29 Mon Sep 17 00:00:00 2001 From: Cole Deck Date: Sun, 12 May 2024 17:56:47 -0500 Subject: [PATCH] Fix cable_search --- jukebox-web | 2 +- run.py | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/jukebox-web b/jukebox-web index 67cb5f8..107858c 160000 --- a/jukebox-web +++ b/jukebox-web @@ -1 +1 @@ -Subproject commit 67cb5f82a995d354b5a67e18ae3486350ec9c269 +Subproject commit 107858c363e8f8e4653f3bbd322a2e9c59788d5c diff --git a/run.py b/run.py index 617ac07..c0e387e 100755 --- a/run.py +++ b/run.py @@ -173,7 +173,6 @@ def check_server(): tmp1["category"] = fs["Product Overview"]["Product Category"] if "Product Overview" in fs and "Suitable Applications" in fs["Product Overview"]: if len(fs["Product Overview"]["Suitable Applications"]) == 0 or not isinstance(fs["Product Overview"]["Suitable Applications"], str): - print(cable_list[idx], fs["Product Overview"]["Suitable Applications"]) for key, value in fs["Product Overview"].items(): #print(key,value) if len(value) > 5 and isinstance(value, str): @@ -184,7 +183,6 @@ def check_server(): tmp1["application"] = fs["Product Overview"]["Suitable Applications"] elif "Product Overview" in fs and "Suitable Applications:" in fs["Product Overview"]: if len(fs["Product Overview"]["Suitable Applications:"]) == 0 or not isinstance(fs["Product Overview"]["Suitable Applications:"], str): - print(cable_list[idx], fs["Product Overview"]["Suitable Applications:"]) for key, value in fs["Product Overview"].items(): #print(key,value) if len(value) > 5 and isinstance(value, str): @@ -253,12 +251,11 @@ def check_server(): for cabledata in results: fs = cabledata["fullspecs"] - tmp1 = {"part_number": cable_list[idx], "position": idx, "name": cable_list[idx], "brand": cabledata["brand"] } + tmp1 = {"part_number": cabledata["partnum"], "position": cabledata["position"], "name": cabledata["partnum"], "brand": cabledata["brand"] } if "Product Overview" in fs and "Product Category" in fs["Product Overview"]: tmp1["category"] = fs["Product Overview"]["Product Category"] if "Product Overview" in fs and "Suitable Applications" in fs["Product Overview"]: if len(fs["Product Overview"]["Suitable Applications"]) == 0 or not isinstance(fs["Product Overview"]["Suitable Applications"], str): - print(cable_list[idx], fs["Product Overview"]["Suitable Applications"]) for key, value in fs["Product Overview"].items(): #print(key,value) if len(value) > 5 and isinstance(value, str): @@ -269,7 +266,6 @@ def check_server(): tmp1["application"] = fs["Product Overview"]["Suitable Applications"] elif "Product Overview" in fs and "Suitable Applications:" in fs["Product Overview"]: if len(fs["Product Overview"]["Suitable Applications:"]) == 0 or not isinstance(fs["Product Overview"]["Suitable Applications:"], str): - print(cable_list[idx], fs["Product Overview"]["Suitable Applications:"]) for key, value in fs["Product Overview"].items(): #print(key,value) if len(value) > 5 and isinstance(value, str):