From 2d2f7dc5af2b9101f0441b242ce12f6a79f760bd Mon Sep 17 00:00:00 2001 From: April Date: Fri, 4 Nov 2022 20:45:08 -0700 Subject: [PATCH] Add function to obtain Metro cities in the area --- Util/MachineProductCfg.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Util/MachineProductCfg.py b/Util/MachineProductCfg.py index 82064eb..0e68b3b 100644 --- a/Util/MachineProductCfg.py +++ b/Util/MachineProductCfg.py @@ -29,6 +29,14 @@ def getPrimaryLocations(): return locationIds +def getMetroCities(): + """ Returns all Metro Map locations in the MPC """ + locationIds = [] + + for i in data['Config']['ConfigDef']['ConfigItems']['ConfigItem']: + if 'MetroMapCity' in i['@key'] and i['@value'] != "": + locationIds.append(i['@value'].split("_")[2]) + def getTideStations(): """ Returns all of the tide stations present in the MachineProductCfg """ stations = []