summaryrefslogtreecommitdiff
path: root/lib/python/qmk/info.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python/qmk/info.py')
-rw-r--r--lib/python/qmk/info.py23
1 files changed, 16 insertions, 7 deletions
diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py
index 7e588b5182..af3b0f3091 100644
--- a/lib/python/qmk/info.py
+++ b/lib/python/qmk/info.py
@@ -10,7 +10,6 @@ from qmk.constants import CHIBIOS_PROCESSORS, LUFA_PROCESSORS, VUSB_PROCESSORS
from qmk.c_parse import find_layouts, parse_config_h_file, find_led_config
from qmk.json_schema import deep_update, json_load, validate
from qmk.keyboard import config_h, rules_mk
-from qmk.keymap import list_keymaps, locate_keymap
from qmk.commands import parse_configurator_json
from qmk.makefile import parse_rules_mk_file
from qmk.math import compute
@@ -99,10 +98,6 @@ def info_json(keyboard):
'maintainer': 'qmk',
}
- # Populate the list of JSON keymaps
- for keymap in list_keymaps(keyboard, c=False, fullpath=True):
- info_data['keymaps'][keymap.name] = {'url': f'https://raw.githubusercontent.com/qmk/qmk_firmware/master/{keymap}/keymap.json'}
-
# Populate layout data
layouts, aliases = _search_keyboard_h(keyboard)
@@ -561,8 +556,16 @@ def _process_defaults(info_data):
for default_type in defaults_map.keys():
thing_map = defaults_map[default_type]
if default_type in info_data:
- for key, value in thing_map.get(info_data[default_type], {}).items():
- info_data[key] = value
+ merged_count = 0
+ thing_items = thing_map.get(info_data[default_type], {}).items()
+ for key, value in thing_items:
+ if key not in info_data:
+ info_data[key] = value
+ merged_count += 1
+
+ if merged_count == 0 and len(thing_items) > 0:
+ _log_warning(info_data, 'All defaults for \'%s\' were skipped, potential redundant config or misconfiguration detected' % (default_type))
+
return info_data
@@ -864,6 +867,9 @@ def find_info_json(keyboard):
def keymap_json_config(keyboard, keymap):
"""Extract keymap level config
"""
+ # TODO: resolve keymap.py and info.py circular dependencies
+ from qmk.keymap import locate_keymap
+
keymap_folder = locate_keymap(keyboard, keymap).parent
km_info_json = parse_configurator_json(keymap_folder / 'keymap.json')
@@ -873,6 +879,9 @@ def keymap_json_config(keyboard, keymap):
def keymap_json(keyboard, keymap):
"""Generate the info.json data for a specific keymap.
"""
+ # TODO: resolve keymap.py and info.py circular dependencies
+ from qmk.keymap import locate_keymap
+
keymap_folder = locate_keymap(keyboard, keymap).parent
# Files to scan