mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-07 23:28:07 +00:00
protob: fix check.py to match proper prefix
This commit is contained in:
parent
617f8fee62
commit
86e124e3b2
@ -1,15 +1,18 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
from glob import glob
|
from glob import glob
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
error = False
|
error = False
|
||||||
|
|
||||||
MYDIR = os.path.dirname(__file__)
|
MYDIR = os.path.dirname(__file__)
|
||||||
|
|
||||||
|
EXPECTED_PREFIX_RE = re.compile(r"messages-(\w+)\.proto")
|
||||||
|
|
||||||
for fn in sorted(glob(os.path.join(MYDIR, "messages-*.proto"))):
|
for fn in sorted(glob(os.path.join(MYDIR, "messages-*.proto"))):
|
||||||
with open(fn, "rt") as f:
|
with open(fn, "rt") as f:
|
||||||
prefix = fn.split(".")[0][9:].capitalize()
|
prefix = EXPECTED_PREFIX_RE.search(fn).group(1).capitalize()
|
||||||
if prefix in ["Bitcoin", "Bootloader", "Common", "Crypto", "Management"]:
|
if prefix in ["Bitcoin", "Bootloader", "Common", "Crypto", "Management"]:
|
||||||
continue
|
continue
|
||||||
if prefix == "Nem":
|
if prefix == "Nem":
|
||||||
|
Loading…
Reference in New Issue
Block a user