diff options
| author | deftk | 2023-10-10 20:23:42 +0200 |
|---|---|---|
| committer | Jules Aguillon | 2023-11-25 19:08:24 +0100 |
| commit | 851d22da6e764cf10fc07aacead14f32fba33195 (patch) | |
| tree | 14e1a8cc70c343d6add0ee17a125069521ddce0c /check_layout.py | |
| parent | 44adb555449110e1fbe8238fed7ed87aa0f9aa5b (diff) | |
| download | unexpected-keyboard-851d22da6e764cf10fc07aacead14f32fba33195.tar.gz unexpected-keyboard-851d22da6e764cf10fc07aacead14f32fba33195.zip | |
Make check_layout.py independent from dir structure
Diffstat (limited to 'check_layout.py')
| -rw-r--r-- | check_layout.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/check_layout.py b/check_layout.py index 66b6bbe..efa34d8 100644 --- a/check_layout.py +++ b/check_layout.py @@ -1,13 +1,12 @@ import xml.etree.ElementTree as ET -import sys +import sys, os 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", - "res/xml/emoji_bottom_row.xml" ]) + "number_row", "numpad", "pin", + "bottom_row", "settings", "method", + "greekmath", "numeric", "emoji_bottom_row" ]) def warn(msg): global warning_count @@ -85,13 +84,14 @@ def check_layout(layout): warn("Layout doesn't specify a script.") for fname in sorted(sys.argv[1:]): - if fname in KNOWN_NOT_LAYOUT: + layout_id, _ = os.path.splitext(os.path.basename(fname)) + if layout_id in KNOWN_NOT_LAYOUT: continue layout = parse_layout(fname) if layout == None: - print("Not a layout file: %s" % fname) + print("Not a layout file: %s" % layout_id) else: - print("# %s" % fname) + print("# %s" % layout_id) warning_count = 0 check_layout(layout) print("%d warnings" % warning_count) |
