Skip to content

Commit 11c6f23

Browse files
committed
Check that all date_added are actually dates (including blinka)
1 parent 4715875 commit 11c6f23

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

tools/check-boards.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/usr/bin/python3
2+
import datetime
23
import os
34
import json
45
import re
56
from pathlib import Path
67
import frontmatter
7-
from dateutil.parser import parse
88

99
# Check CircuitPython Download Features
1010
with open('template.md', "rt") as f:
@@ -31,14 +31,7 @@ def verify_board_id(folder):
3131
return valid
3232

3333
def valid_date(date):
34-
date = str(date)
35-
if date:
36-
try:
37-
parse(date)
38-
return True
39-
except:
40-
return False
41-
return False
34+
return isinstance(date, datetime.date)
4235

4336
def verify_features(folder, valid_features):
4437
valid = True
@@ -160,7 +153,7 @@ def verify_blinka_board(folder):
160153
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")
161154
raise SystemExit(True)
162155

163-
if not verify_date_added("_board") or not verify_date_added("blinka"):
156+
if not verify_date_added("_board") or not verify_date_added("_blinka"):
164157
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")
165158
raise SystemExit(True)
166159

0 commit comments

Comments
 (0)