Additional validation.

* Ensure PID directories only have an index.md
* Ensure PIDs are valid hex.
This commit is contained in:
Scott Shawcroft committed 2020-11-17 22:56:48 -08:00
1 parent b2de95c866
commit 498fd23b10
3 files changed
+10

No files matched your search

File renamed without changes.
File renamed without changes.
+10
View File
@@ -15,10 +15,20 @@ pid0xxx = set([x.name for x in pid0xxx])
ok = True
for index in vid_1209.glob("*/*"):
if index.name != "index.md":
ok = False
print("Invalid file:", index)
for pid in vid_1209.iterdir():
pid = pid.name
if pid == "index.md":
continue
try:
int(pid, 16)
except ValueError:
ok = False
print("PID " + pid + " not valid hex. Must be 4 characters 0-9 or A-F.")
if pid.upper() != pid:
ok = False
print("PID must be upper case:", pid)