Skip to content

Commit c6af63c

Browse files
authored
Standardize on upper case and check length (pidcodes#573)
1 parent edfa727 commit c6af63c

10 files changed

Lines changed: 14 additions & 2 deletions

File tree

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

test/validate_pids.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,31 @@
11
from pathlib import Path
22
import sys
33

4-
existing_0xxx = {'0006', '01C0', '0007', '053A', '0256', '0008', '000f', '0BAB', '0009', '0001', '000a', '0010', '01CB', '000c', '0002', '000e', '0CBD', '000d', '000b', '0003', '0004', '0514', '0005', '0070', '0D32'}
4+
existing_0xxx = {'0006', '01C0', '0007', '053A', '0256', '0008', '000F', '0BAB', '0009', '0001', '000A',
5+
'0010', '01CB', '000C', '0002', '000E', '0CBD', '000D', '000B', '0003', '0004', '0514',
6+
'0005', '0070', '0D32'}
57
existing_1xxx = {'1AB6', '1005', '1776', '1001', '1007', '1AB5', '1002', '1006', '1004', '1003', '1986'}
68

79
vid_1209 = Path("1209")
810
pid1xxx = vid_1209.glob("1*")
911
pid1xxx = set([x.name for x in pid1xxx])
1012

11-
1213
pid0xxx = vid_1209.glob("0*")
1314
pid0xxx = set([x.name for x in pid0xxx])
1415

1516
ok = True
1617

18+
for pid in vid_1209.iterdir():
19+
pid = pid.name
20+
if pid == "index.md":
21+
continue
22+
if pid.upper() != pid:
23+
ok = False
24+
print("PID must be upper case:", pid)
25+
if len(pid) != 4:
26+
ok = False
27+
print("Pid is too long: '" + pid + "'")
28+
1729
if pid1xxx - existing_1xxx:
1830
print("Cannot claim 1xxx PID:", pid1xxx - existing_1xxx)
1931
print("See here for more info: http://pid.codes/1209/")

0 commit comments

Comments
 (0)