Add national airport codes to getAirportCodes()

This commit is contained in:
April 2022-11-13 15:41:01 -07:00
parent cfca3d718a
commit 47fe9a9c47
No known key found for this signature in database
GPG Key ID: 17A9A017FAA4DE5E

View File

@ -50,9 +50,90 @@ def getTideStations():
def getAirportCodes():
""" Returns all of the airport identifiers present in the MachineProductCfg """
airports = []
airports = [
'ATL',
'LAX',
'ORD',
'DFW',
'JFK',
'DEN',
'SFO',
'CLT',
'LAS',
'PHX',
'IAH',
'MIA',
'SEA',
'EWR',
'MCO',
'MSP',
'DTW',
'BOS',
'PHL',
'LGA',
'FLL',
'BWI',
'IAD',
'MDW',
'SLC',
'DCA',
'HNL',
'SAN',
'TPA',
'PDX',
'STL',
'HOU',
'BNA',
'AUS',
'OAK',
'MSY',
'RDU',
'SJC',
'SNA',
'DAL',
'SMF',
'SAT',
'RSW',
'PIT',
'CLE',
'IND',
'MKE',
'CMH',
'OGG',
'PBI',
'BDL',
'CVG',
'JAX',
'ANC',
'BUF',
'ABQ',
'ONT',
'OMA',
'BUR',
'OKC',
'MEM',
'PVD',
'RIC',
'SDF',
'RNO',
'TUS',
'CHS',
'ORF',
'PWM',
'GRR',
'BHM',
'LIT',
'DSM',
'FAR',
'FSD',
'ICT',
'LBB',
'BIL',
'BOI',
'GEG'
]
for i in data['Config']['ConfigDef']['ConfigItems']['ConfigItem']:
if "Airport" in i['@key'] and i['@value'] != "":
if "Airport" in i['@key'] and i['@value'] != "" and not i['@value'] in airports:
# Split the string up
airports.append(i['@value'].split("_")[2])