From 93df91ce5f9321f33ee0ee5d40bd07d0e4e90d3f Mon Sep 17 00:00:00 2001 From: Tobias Schmidt <13055656+schmidtnz@users.noreply.github.com> Date: Thu, 28 Nov 2024 10:29:04 +1300 Subject: [PATCH 1/2] feat: defaults for current-datetime argument TDE-1298 --- scripts/standardise_validate.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/standardise_validate.py b/scripts/standardise_validate.py index 3000e073a..5ac5d5af1 100644 --- a/scripts/standardise_validate.py +++ b/scripts/standardise_validate.py @@ -1,6 +1,7 @@ import argparse import os import sys +from datetime import datetime, timezone from linz_logger import get_log @@ -75,7 +76,8 @@ def parse_args() -> argparse.Namespace: "The datetime to be used as current datetime in the metadata. " "Format: RFC 3339 UTC datetime, `YYYY-MM-DDThh:mm:ssZ`." ), - required=True, + required=False, + default=datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"), ) return parser.parse_args() From 8aaf5f1d81daf1de78ee61964faa6cc908419a1b Mon Sep 17 00:00:00 2001 From: Tobias Schmidt <13055656+schmidtnz@users.noreply.github.com> Date: Thu, 28 Nov 2024 10:49:29 +1300 Subject: [PATCH 2/2] feat: defaults for current-datetime argument TDE-1298 --- scripts/standardise_validate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/standardise_validate.py b/scripts/standardise_validate.py index 5ac5d5af1..c27807649 100644 --- a/scripts/standardise_validate.py +++ b/scripts/standardise_validate.py @@ -6,7 +6,7 @@ from linz_logger import get_log from scripts.cli.cli_helper import InputParameterError, is_argo, load_input_files, str_to_gsd, valid_date -from scripts.datetimes import format_rfc_3339_nz_midnight_datetime_string +from scripts.datetimes import RFC_3339_DATETIME_FORMAT, format_rfc_3339_nz_midnight_datetime_string from scripts.files.file_tiff import FileTiff from scripts.files.files_helper import SUFFIX_JSON, ContentType from scripts.files.fs import exists, write @@ -77,7 +77,7 @@ def parse_args() -> argparse.Namespace: "Format: RFC 3339 UTC datetime, `YYYY-MM-DDThh:mm:ssZ`." ), required=False, - default=datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"), + default=datetime.now(timezone.utc).strftime(RFC_3339_DATETIME_FORMAT), ) return parser.parse_args()