Add more descriptions
This commit is contained in:
parent
faf33aede7
commit
a905858e3b
22
run.py
22
run.py
@ -173,7 +173,27 @@ def check_server():
|
|||||||
if "Product Overview" in fs and "Product Category" in fs["Product Overview"]:
|
if "Product Overview" in fs and "Product Category" in fs["Product Overview"]:
|
||||||
tmp1["short_description"] = fs["Product Overview"]["Product Category"]
|
tmp1["short_description"] = fs["Product Overview"]["Product Category"]
|
||||||
if "Product Overview" in fs and "Suitable Applications" in fs["Product Overview"]:
|
if "Product Overview" in fs and "Suitable Applications" in fs["Product Overview"]:
|
||||||
tmp1["description"] = fs["Product Overview"]["Suitable Applications"]
|
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)
|
tmp.append(tmp1)
|
||||||
out = {"map": tmp}
|
out = {"map": tmp}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user