summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2021-11-05 08:49:09 +1100
committerGitHub <noreply@github.com>2021-11-04 21:49:09 +0000
commitc8da63382c7d2cc0de13559c10b5fde0f436f9e3 (patch)
treeb4e68ade12e09efd5d84c3237273e976dd8b154f /lib
parentc8b09d0d4ab73c88c6ae84718f0c890640dfbece (diff)
Fixup actions. (#15057)
Diffstat (limited to 'lib')
-rw-r--r--lib/python/qmk/info.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py
index 85131b9299..cc99484519 100644
--- a/lib/python/qmk/info.py
+++ b/lib/python/qmk/info.py
@@ -25,6 +25,13 @@ def _valid_community_layout(layout):
return (Path('layouts/default') / layout).exists()
+def _remove_newlines_from_labels(layouts):
+ for layout_name, layout_json in layouts.items():
+ for key in layout_json['layout']:
+ if '\n' in key['label']:
+ key['label'] = key['label'].split('\n')[0]
+
+
def info_json(keyboard):
"""Generate the info.json data for a specific keyboard.
"""
@@ -100,10 +107,7 @@ def info_json(keyboard):
_check_matrix(info_data)
# Remove newline characters from layout labels
- for layout_name, layout_json in layouts.items():
- for key in layout_json['layout']:
- if '\n' in key['label']:
- key['label'] = key['label'].split('\n')[0]
+ _remove_newlines_from_labels(layouts)
return info_data