ci_vial_verify_uid: fix when keyboard has several vial keymaps

This commit is contained in:
Ilya Zhuravlev 2021-07-04 09:20:39 -04:00
parent 63abe5116f
commit a8097046f5

View file

@ -9,7 +9,7 @@ from collections import defaultdict
def main(): def main():
error = 0 error = 0
uid_to_keyboards = defaultdict(list) uid_to_keyboards = defaultdict(set)
for filename in glob("keyboards/**/vial.json", recursive=True): for filename in glob("keyboards/**/vial.json", recursive=True):
keyboard = filename[10:-10].split("/keymaps/")[0] keyboard = filename[10:-10].split("/keymaps/")[0]
@ -38,7 +38,7 @@ def main():
uid = uid[0].split(",") uid = uid[0].split(",")
uid = [int(x, 16) for x in uid] uid = [int(x, 16) for x in uid]
uid = struct.pack("BBBBBBBB", *uid).hex() uid = struct.pack("BBBBBBBB", *uid).hex()
uid_to_keyboards[uid].append(keyboard) uid_to_keyboards[uid].add(keyboard)
print("{} uses UID {}".format(keyboard, uid)) print("{} uses UID {}".format(keyboard, uid))