From 76f01122c2f60a51e5c2d4cdf289e5136cd50752 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sat, 5 Aug 2023 17:58:13 +0200 Subject: Tweak check_layout.py - Warn about missing esc, tab, f11_placeholder and f12_placeholder. - Don't check non-layout files and special layouts. --- check_layout.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'check_layout.py') diff --git a/check_layout.py b/check_layout.py index d242010..e5e14dc 100644 --- a/check_layout.py +++ b/check_layout.py @@ -3,6 +3,11 @@ import sys warning_count = 0 +KNOWN_NOT_LAYOUT = set([ + "res/xml/number_row.xml", "res/xml/numpad.xml", "res/xml/pin.xml", + "res/xml/bottom_row.xml", "res/xml/settings.xml", "res/xml/method.xml", + "res/xml/greekmath.xml", "res/xml/numeric.xml" ]) + def warn(msg): global warning_count print(msg) @@ -44,9 +49,10 @@ def check_layout(layout): root, keys = layout missing_some_of(keys, "~!@#$%^&*(){}`[]=\\-_;:/.,?<>'\"+|", "ASCII punctuation") missing_some_of(keys, "0123456789", "digits") - missing_some_of(keys, ["f11_placeholder", "f12_placeholder"]) - missing_some_of(keys, ["esc", "tab"]) - missing_required(keys, ["backspace", "delete"], "Layout doesn't define some important keys") + missing_required(keys, + ["esc", "tab", "backspace", "delete", + "f11_placeholder", "f12_placeholder"], + "Layout doesn't define some important keys") unexpected_keys(keys, ["copy", "paste", "cut", "selectAll", "shareText", "pasteAsPlainText", "undo", "redo", "replaceText", @@ -74,6 +80,8 @@ def check_layout(layout): warn("Layout doesn't specify a script.") for fname in sys.argv[1:]: + if fname in KNOWN_NOT_LAYOUT: + continue layout = parse_layout(fname) if layout == None: print("Not a layout file: %s" % fname) -- cgit v1.2.3