From fd1b69c49ba8f70e74a1bc41bd98dd04e88a0572 Mon Sep 17 00:00:00 2001 From: April Date: Mon, 17 Oct 2022 21:21:12 -0700 Subject: [PATCH] getZones function for MachineProductCfg.py --- Util/MachineProductCfg.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Util/MachineProductCfg.py b/Util/MachineProductCfg.py index c0ad8f9..df9f15f 100644 --- a/Util/MachineProductCfg.py +++ b/Util/MachineProductCfg.py @@ -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()) \ No newline at end of file