diff --git a/SEPTREFHUM.py b/SEPTREFHUM.py index 7bd9083a04a0422ce4512084064949a9cfb957ef..cbf2ebe46500af2ab0db0eeb6b31843cef878707 100755 --- a/SEPTREFHUM.py +++ b/SEPTREFHUM.py @@ -66,6 +66,7 @@ tmpfile_path = f"tmp/{year}/" TEMPERATURE_THRESHOLD = 8.0 DEBUG = False if os.getenv("DEBUG") is None or os.getenv("DEBUG").lower() == "false" else True +logging.getLogger().handlers.clear() logging.basicConfig( level=logging.DEBUG if DEBUG else logging.INFO, format="%(asctime)s - %(levelname).4s - (%(filename)s:%(lineno)d) - %(message)s", @@ -78,7 +79,7 @@ start_date = None last_wh_date = None #""" for wh_file in glob.glob(f"{tmpfile_path}wh_2[0-9][0-9][0-9]-[01][0-9]-[0123][0-9].nc"): - current_wh_file_date = local_timezone.localize(datetime.strptime(f"{wh_file[7:17]}", "%Y-%m-%d")) + current_wh_file_date = local_timezone.localize(datetime.strptime(f"{wh_file[12:22]}", "%Y-%m-%d")) if last_wh_date is None or last_wh_date < current_wh_file_date: last_wh_date = current_wh_file_date if last_wh_date is not None: