fix bugs in the DWD crawler
This commit is contained in:
@@ -110,7 +110,8 @@ class DwdCrawler():
|
||||
for line in content.splitlines():
|
||||
if '' == line:
|
||||
if 0 != len(windTable):
|
||||
windInformation.append(( areaIds, windTable ))
|
||||
for id in areaIds:
|
||||
windInformation.append([ id, windTable ])
|
||||
areaIds = None
|
||||
windTable = []
|
||||
elif line.startswith('GAFOR-Gebiete'):
|
||||
@@ -145,13 +146,14 @@ class DwdCrawler():
|
||||
|
||||
# receive the wind data
|
||||
self.UpdateTime = None
|
||||
self.WindData = []
|
||||
self.WindData = {}
|
||||
for page in pages:
|
||||
next, wind = self.parseGaforPage(page)
|
||||
if None != next:
|
||||
if None == self.UpdateTime or self.UpdateTime > next:
|
||||
self.UpdateTime = next
|
||||
self.WindData.extend(wind)
|
||||
for gafor in wind:
|
||||
self.WindData[gafor[0]] = gafor[1]
|
||||
|
||||
# indicate that new wind data is available
|
||||
if None != self.UpdateTime:
|
||||
|
||||
Reference in New Issue
Block a user