From cf8ec3242ea60b89c4e37a2e287149346bd367d8 Mon Sep 17 00:00:00 2001 From: Sven Czarnian Date: Sat, 13 Nov 2021 09:45:17 +0100 Subject: [PATCH] fix bugs in the DWD crawler --- aman/com/DwdCrawler.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/aman/com/DwdCrawler.py b/aman/com/DwdCrawler.py index d52731a..189027e 100644 --- a/aman/com/DwdCrawler.py +++ b/aman/com/DwdCrawler.py @@ -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: