getZones function for MachineProductCfg.py

This commit is contained in:
April 2022-10-17 21:21:12 -07:00
parent f7314f286f
commit fd1b69c49b
No known key found for this signature in database
GPG Key ID: 17A9A017FAA4DE5E

View File

@ -35,5 +35,17 @@ def getAirportCodes():
return airports
def getZones():
""" Returns a list of zones present in the MachineProductCfg """
zones = []
for i in data['Config']['ConfigDef']['ConfigItems']['ConfigItem']:
if i['@key'] == "primaryZone" and i['@value'] != "":
zones.append(i['@value']) # This should only be one value
print(getPrimaryLocations())
if i['@key'] == "secondaryZones" and i['@value'] != "":
for x in i['@value'].split(','):
zones.append(x)
return zones
print(getZones())