allow unset weather provider
This commit is contained in:
@@ -28,15 +28,16 @@ class ComThread(Thread):
|
||||
report.ParseFromString(msg)
|
||||
|
||||
# try to associate the received aircrafts to airports
|
||||
icao = []
|
||||
icao = None
|
||||
for inbound in report.reports:
|
||||
self.AMAN.updateAircraftReport(inbound)
|
||||
icao = inbound.destination
|
||||
|
||||
# get the sequence of the airport
|
||||
airport = self.AMAN.findAirport(icao)
|
||||
if None != airport:
|
||||
self.Com.sendSequence('', airport.inboundSequence(), airport.WeatherModel)
|
||||
if None != icao:
|
||||
airport = self.AMAN.findAirport(icao)
|
||||
if None != airport:
|
||||
self.Com.sendSequence(icao, airport.inboundSequence(), airport.WeatherModel)
|
||||
|
||||
except zmq.ZMQError as error:
|
||||
if zmq.EAGAIN == error.errno:
|
||||
|
||||
@@ -21,7 +21,7 @@ class Weather(Thread):
|
||||
|
||||
if 'DWD' == config.Provider.upper():
|
||||
self.Provider = DwdCrawler()
|
||||
else:
|
||||
elif 'NONE' != config.Provider.upper():
|
||||
sys.stderr.write('Invalid or unknown weather-provider defined')
|
||||
sys.exit(-1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user