From 86e124e3b214ac7470590a1f31b9fcff6559d9c0 Mon Sep 17 00:00:00 2001 From: matejcik Date: Thu, 21 Mar 2019 12:30:37 +0100 Subject: [PATCH] protob: fix check.py to match proper prefix --- protob/check.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/protob/check.py b/protob/check.py index 13331deaa1..0b612d4e8d 100755 --- a/protob/check.py +++ b/protob/check.py @@ -1,15 +1,18 @@ #!/usr/bin/env python3 from glob import glob import os +import re import sys error = False 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"))): 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"]: continue if prefix == "Nem":