diff options
| author | Jules Aguillon | 2023-06-25 16:48:18 +0200 |
|---|---|---|
| committer | Jules Aguillon | 2023-06-25 16:48:18 +0200 |
| commit | de6c3b024d9879fffc608126d974756624d6eec7 (patch) | |
| tree | 55cfd1781493272f7571025da05f58577a217fbb /gen_layouts.py | |
| parent | 15c608b8cd663bf9267ade94d689164762c40ed9 (diff) | |
| download | unexpected-keyboard-de6c3b024d9879fffc608126d974756624d6eec7.tar.gz unexpected-keyboard-de6c3b024d9879fffc608126d974756624d6eec7.zip | |
Update guidelines about adding layouts
to reflect the recent changes. Also, change `gen_layouts.py` to not
generate warnings for file that are known not to be layouts.
Diffstat (limited to 'gen_layouts.py')
| -rw-r--r-- | gen_layouts.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gen_layouts.py b/gen_layouts.py index bea9ba1..a8f13c8 100644 --- a/gen_layouts.py +++ b/gen_layouts.py @@ -11,6 +11,11 @@ import xml.etree.ElementTree as XML # are sorted alphabetically. FIRST_LAYOUTS = [ "latn_qwerty_us", "latn_colemak", "latn_dvorak" ] +# File names that are known not to be layouts. Avoid warning about them. +KNOWN_NOT_LAYOUT = set([ + "number_row", "numpad", "pin", "bottom_row", "settings", "method", + "greekmath", "numeric" ]) + # Read a layout from a file. Returns [None] if [fname] is not a layout. def read_layout(fname): root = XML.parse(fname).getroot() @@ -23,7 +28,9 @@ def read_layouts(files): for layout_file in files: layout_id, _ = os.path.splitext(os.path.basename(layout_file)) layout = read_layout(layout_file) - if layout == None: + if layout_id in KNOWN_NOT_LAYOUT: + continue + elif layout == None: print("Not a layout file: %s" % layout_file) elif layout["name"] == None: print("Layout doesn't have a name: %s" % layout_id) |
