Browse Source

fix bugs in the DWD crawler

Sven Czarnian 3 years ago
parent
commit
cf8ec3242e
1 changed files with 5 additions and 3 deletions
  1. 5 3
      aman/com/DwdCrawler.py

+ 5 - 3
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: