diff options
author | sendmmsg <47253595+sendmmsg@users.noreply.github.com> | 2021-06-24 04:27:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-24 12:27:10 +1000 |
commit | d45a24a9546fec52998c66c68a5b3a4306f50199 (patch) | |
tree | 5cb5aec868ea54b73e8f37b896936d19db537ae3 /keyboards/ergodox_ez/util/keymap_beautifier | |
parent | 480b7e595ec53a891e35895d6707deb000aeb578 (diff) | |
download | qmk_firmware-d45a24a9546fec52998c66c68a5b3a4306f50199.tar.gz qmk_firmware-d45a24a9546fec52998c66c68a5b3a4306f50199.zip |
bug if macro definition and not integer is used to identify layers (#12648)
Diffstat (limited to 'keyboards/ergodox_ez/util/keymap_beautifier')
-rwxr-xr-x | keyboards/ergodox_ez/util/keymap_beautifier/KeymapBeautifier.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/keyboards/ergodox_ez/util/keymap_beautifier/KeymapBeautifier.py b/keyboards/ergodox_ez/util/keymap_beautifier/KeymapBeautifier.py index 6b6f391ce5..f55bdaf2d7 100755 --- a/keyboards/ergodox_ez/util/keymap_beautifier/KeymapBeautifier.py +++ b/keyboards/ergodox_ez/util/keymap_beautifier/KeymapBeautifier.py @@ -164,7 +164,16 @@ class KeymapBeautifier: key_symbols = [key_symbols[i] for i in self.index_conversion_map_reversed(self.INDEX_CONVERSTION_LAYOUT_ergodox_pretty_to_LAYOUT_ergodox)] padded_key_symbols = self.pad_key_symbols(key_symbols, input_layout) - current_pretty_output_layer = self.pretty_output_layer(layer.name[0].value, padded_key_symbols) + + layer_identifier = None + if hasattr(layer.name[0], "value"): + layer_identifier = layer.name[0].value + elif hasattr(layer.name[0], "name"): + layer_identifier = layer.name[0].name + else: + raise AttributeError("Layer is missing both index and name (e.g., [BASE] = LAYOUT_ergodox(...))") + + current_pretty_output_layer = self.pretty_output_layer(layer_identifier, padded_key_symbols) # strip trailing spaces from padding layer_output.append(re.sub(r" +\n", "\n", current_pretty_output_layer)) |