Skip to content
Snippets Groups Projects
Commit 36ab382d authored by Lene Wasskog's avatar Lene Wasskog
Browse files

chore: Clear logging config, fix date extraction

parent 0e07f060
No related branches found
No related tags found
No related merge requests found
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment