Check that all date_added are actually dates (including blinka)

This commit is contained in:
Jeff Epler 2024-03-22 11:32:13 -05:00
parent 4715875cc4
commit 11c6f23a1c

View file

@ -1,10 +1,10 @@
#!/usr/bin/python3
import datetime
import os
import json
import re
from pathlib import Path
import frontmatter
from dateutil.parser import parse
# Check CircuitPython Download Features
with open('template.md', "rt") as f:
@ -31,14 +31,7 @@ def verify_board_id(folder):
return valid
def valid_date(date):
date = str(date)
if date:
try:
parse(date)
return True
except:
return False
return False
return isinstance(date, datetime.date)
def verify_features(folder, valid_features):
valid = True
@ -160,7 +153,7 @@ if not verify_family("_board"):
print("Family or not found or invalid value. See https://learn.adafruit.com/how-to-add-a-new-board-to-the-circuitpython-org-website/adding-to-downloads for details")
raise SystemExit(True)
if not verify_date_added("_board") or not verify_date_added("blinka"):
if not verify_date_added("_board") or not verify_date_added("_blinka"):
print("Date Added field not found or invalid value. See https://learn.adafruit.com/how-to-add-a-new-board-to-the-circuitpython-org-website/adding-to-downloads for details")
raise SystemExit(True)