29
29
import re
30
30
import sys
31
31
32
- DEFAULT_WHITELIST = [
32
+ DEFAULT_IGNORELIST = [
33
33
"circuitplayground_express" ,
34
34
"circuitplayground_express_crickit" ,
35
35
"circuitplayground_express_displayio" ,
43
43
44
44
cli_parser = argparse .ArgumentParser (description = "USB VID/PID Duplicate Checker" )
45
45
cli_parser .add_argument (
46
- "--whitelist " ,
47
- dest = "whitelist " ,
46
+ "--ignorelist " ,
47
+ dest = "ignorelist " ,
48
48
nargs = "?" ,
49
49
action = "store" ,
50
- default = DEFAULT_WHITELIST ,
50
+ default = DEFAULT_IGNORELIST ,
51
51
help = (
52
52
"Board names to ignore duplicate VID/PID combinations. Pass an empty "
53
53
"string to disable all duplicate ignoring. Defaults are: "
54
- f"{ ', ' .join (DEFAULT_WHITELIST )} "
54
+ f"{ ', ' .join (DEFAULT_IGNORELIST )} "
55
55
)
56
56
)
57
57
@@ -69,7 +69,7 @@ def configboard_files():
69
69
)
70
70
return working_dir .glob ("ports/**/boards/**/mpconfigboard.mk" )
71
71
72
- def check_vid_pid (files , whitelist ):
72
+ def check_vid_pid (files , ignorelist ):
73
73
""" Compiles a list of USB VID & PID values for all boards, and checks
74
74
for duplicates. Exits with ``sys.exit()`` (non-zero exit code)
75
75
if duplicates are found, and lists the duplicates.
@@ -90,10 +90,10 @@ def check_vid_pid(files, whitelist):
90
90
91
91
board_name = board_config .parts [- 2 ]
92
92
93
- board_whitelisted = False
94
- if board_name in whitelist :
95
- board_whitelisted = True
96
- board_name += " (whitelisted )"
93
+ board_ignorelisted = False
94
+ if board_name in ignorelist :
95
+ board_ignorelisted = True
96
+ board_name += " (ignorelisted )"
97
97
98
98
if usb_vid and usb_pid :
99
99
id_group = f"{ usb_vid .group (1 )} :{ usb_pid .group (1 )} "
@@ -104,7 +104,7 @@ def check_vid_pid(files, whitelist):
104
104
}
105
105
else :
106
106
usb_ids [id_group ]['boards' ].append (board_name )
107
- if not board_whitelisted :
107
+ if not board_ignorelisted :
108
108
usb_ids [id_group ]['duplicate' ] = True
109
109
duplicates_found = True
110
110
@@ -128,9 +128,9 @@ def check_vid_pid(files, whitelist):
128
128
129
129
print ("Running USB VID/PID Duplicate Checker..." )
130
130
print (
131
- f"Ignoring the following boards: { ', ' .join (arguments .whitelist )} " ,
131
+ f"Ignoring the following boards: { ', ' .join (arguments .ignorelist )} " ,
132
132
end = "\n \n "
133
133
)
134
134
135
135
board_files = configboard_files ()
136
- check_vid_pid (board_files , arguments .whitelist )
136
+ check_vid_pid (board_files , arguments .ignorelist )
0 commit comments