split lists if they contain more than 2 commas

This commit is contained in:
Camryn Thomas 2024-03-01 19:13:28 -06:00
parent e903150fd4
commit fc9ff4c8b2
Signed by: cptlobster
GPG Key ID: 6D341D688163A176

View File

@ -232,6 +232,10 @@ def flatten(tables):
print("\"" + keyname + "\":", "\"" + str(out[fullkeyname]) + "\",") print("\"" + keyname + "\":", "\"" + str(out[fullkeyname]) + "\",")
# if the item has at least two commas in it, split it
if tables[table][key].count(',') >= 2:
out[fullkeyname] = map(lambda x: x.strip(), tables[table][key].split(","))
print("}") print("}")
return out return out