Pull description from Belden API for more consistent values
This commit is contained in:
12
run.py
12
run.py
@@ -168,8 +168,6 @@ def check_server():
|
||||
cabledata = jbs.get_position(str(idx))
|
||||
fs = cabledata["fullspecs"]
|
||||
tmp1 = {"part_number": cable_list[idx], "position": idx, "name": cable_list[idx], "brand": cabledata["brand"] }
|
||||
if "image" in cabledata:
|
||||
tmp1["image"] = cabledata["image"]
|
||||
if "Product Overview" in fs and "Product Category" in fs["Product Overview"]:
|
||||
tmp1["short_description"] = fs["Product Overview"]["Product Category"]
|
||||
if "Product Overview" in fs and "Suitable Applications" in fs["Product Overview"]:
|
||||
@@ -194,7 +192,15 @@ def check_server():
|
||||
tmp1["description"] = key
|
||||
else:
|
||||
tmp1["description"] = fs["Product Overview"]["Suitable Applications:"]
|
||||
|
||||
if "image" in cabledata:
|
||||
tmp1["image"] = cabledata["image"]
|
||||
if "description" in cabledata:
|
||||
tmp1["description"] = cabledata["description"]
|
||||
if "short_description" in cabledata:
|
||||
tmp1["short_description"] = cabledata["short_description"]
|
||||
if "application" in cabledata:
|
||||
tmp1["application"] = cabledata["application"]
|
||||
|
||||
tmp.append(tmp1)
|
||||
out = {"map": tmp}
|
||||
fprint(out)
|
||||
|
||||
Reference in New Issue
Block a user