rename the configuration flag

This commit is contained in:
Sven Czarnian
2021-11-15 21:14:31 +01:00
parent 4be95869b0
commit 8426d7cd30
2 changed files with 5 additions and 5 deletions

View File

@@ -13,7 +13,7 @@ class AirportSequencing:
self.ActiveArrivalRunways = [] self.ActiveArrivalRunways = []
self.RunwayDependencies = [] self.RunwayDependencies = []
self.LastUpdateTimestamp = dt.utcfromtimestamp(int(time.time())).replace(tzinfo = pytz.UTC) self.LastUpdateTimestamp = dt.utcfromtimestamp(int(time.time())).replace(tzinfo = pytz.UTC)
self.UseMustShallMay = True self.UseShallShouldMay = True
def clearData(self): def clearData(self):
self.ActiveArrivalRunways.clear() self.ActiveArrivalRunways.clear()

8
app.py
View File

@@ -54,7 +54,7 @@ def configuration(icao):
dictionary = { dictionary = {
'airport' : airport.Icao, 'airport' : airport.Icao,
'useMustShallMay' : config.UseMustShallMay, 'useShallShouldMay' : config.UseShallShouldMay,
'activeRunways' : config.ActiveArrivalRunways, 'activeRunways' : config.ActiveArrivalRunways,
'dependentRunways' : dependencies 'dependentRunways' : dependencies
} }
@@ -93,15 +93,15 @@ def configure():
return Response('{}', status=404, mimetype='application/json') return Response('{}', status=404, mimetype='application/json')
# check that all top-level information are available # check that all top-level information are available
if 'useMustShallMay' not in data or 'activeRunways' not in data or 'dependentRunways' not in data: if 'useShallShouldMay' not in data or 'activeRunways' not in data or 'dependentRunways' not in data:
return Response('{}', status=404, mimetype='application/json') return Response('{}', status=404, mimetype='application/json')
if False == isinstance(data['useMustShallMay'], bool) or 0 == len(data['activeRunways']): if False == isinstance(data['useShallShouldMay'], bool) or 0 == len(data['activeRunways']):
return Response('{}', status=404, mimetype='application/json') return Response('{}', status=404, mimetype='application/json')
# create the toplevel information # create the toplevel information
config = AirportSequencing(airport.Icao) config = AirportSequencing(airport.Icao)
config.Airport = data['airport'].upper() config.Airport = data['airport'].upper()
config.UseMustShallMay = data['useMustShallMay'] config.UseShallShouldMay = data['useShallShouldMay']
# parse the active runways # parse the active runways
for activeRunway in data['activeRunways']: for activeRunway in data['activeRunways']: