Add more descriptions

This commit is contained in:
Cole Deck 2024-05-08 15:48:26 -05:00
parent faf33aede7
commit a905858e3b

20
run.py
View File

@ -173,7 +173,27 @@ def check_server():
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"]:
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):
tmp1["description"] = value
elif len(key) > 15 and not isinstance(value, str):
tmp1["description"] = key
else:
tmp1["description"] = 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):
tmp1["description"] = value
elif len(key) > 15 and not isinstance(value, str):
tmp1["description"] = key
else:
tmp1["description"] = fs["Product Overview"]["Suitable Applications:"]
tmp.append(tmp1)
out = {"map": tmp}