Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
Merge cf1d5b6 into a084400
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdonnnj committed Jan 21, 2022
2 parents a084400 + cf1d5b6 commit 990128d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/mdyml/convert_cisagov.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ def convert() -> None:
table_rows.append(line)
logging.info("Done reading Markdown table with %d rows.", len(table_rows))

# The timestamp to use if there is no timestamp in the row. Since the
# conversion is logically one action it should be the same for all converted
# data.
default_timestamp = datetime.now(timezone.utc).isoformat(timespec="seconds")

# Process all the data into a list of dictionaries
out_dict_list = []
row_count = 0
Expand Down Expand Up @@ -155,9 +160,7 @@ def convert() -> None:
parsed_date.replace(tzinfo=timezone.utc)
out_dict["last_updated"] = parsed_date.isoformat(timespec="seconds")
else:
out_dict["last_updated"] = datetime.now(timezone.utc).isoformat(
timespec="seconds"
)
out_dict["last_updated"] = default_timestamp

out_dict_list.append(out_dict)

Expand Down

0 comments on commit 990128d

Please sign in to comment.