diff --git a/src/main/python/fallback_csv.py b/src/main/python/fallback_csv.py index 107df7b..34e9c37 100644 --- a/src/main/python/fallback_csv.py +++ b/src/main/python/fallback_csv.py @@ -34,7 +34,7 @@ def cache_content(from_time, to_time, data, dtype): return return_string -def generate(master_dir, from_time, to_time, cache_file, dtype): +def generate(master_dir, from_time, to_time, cache_file, dtype, qt_text_browser): timeframes = [] @@ -75,6 +75,9 @@ def generate(master_dir, from_time, to_time, cache_file, dtype): # skip shit data # if float(temp) < -100 or float(hum) < 0: + wtext = "WARNING: Skipping broken DWD data @{} (hum: {}, temp: {}".format( + date, hum, temp) + qt_text_browser.append(wtext) continue # append data # @@ -88,6 +91,7 @@ def generate(master_dir, from_time, to_time, cache_file, dtype): # save values # timeframes.append((start, end, data)) + qt_text_browser.append("INFO: FILE: {}, START: {}, END: {}".format(fname, start, end)) info_for_output_if_error.append("{}\n{} bis {}".format(fname, start, end)) # find a fitting frame # diff --git a/src/main/python/input_backend.py b/src/main/python/input_backend.py index e586638..95fc214 100644 --- a/src/main/python/input_backend.py +++ b/src/main/python/input_backend.py @@ -132,7 +132,7 @@ def processExternalData(datapoints, plotNameKey, fromTime, toTime, dtype, qtText if r.status_code != 200 or "nicht gefunden" in r.text.lower(): qtTextBrowser.append(de.failed_to_retrieve.format("NOT FOUND")) qtTextBrowser.append("Versuche von DWD-Datei zu laden - Dass kann einen Moment dauern") - content = fallback_csv.generate(CFG("dwd_dir"), fromTime, toTime, cacheFile, dtype) + content = fallback_csv.generate(CFG("dwd_dir"), fromTime, toTime, cacheFile, dtype, qtTextBrowser) else: qtTextBrowser.append(de.pg_request.format(url)) content = r.content.decode('utf-8', "ignore") # ignore bad bytes