diff --git a/lib/python/qmk/build_targets.py b/lib/python/qmk/build_targets.py index 387da0366b4e..a1912419c4be 100644 --- a/lib/python/qmk/build_targets.py +++ b/lib/python/qmk/build_targets.py @@ -23,7 +23,7 @@ def __init__(self, keyboard: str, keymap: str, json: Union[dict, Dotty] = None): self._target = f'{self._keyboard_safe}_{self.keymap}' self._intermediate_output = Path(f'{INTERMEDIATE_OUTPUT_PREFIX}{self._target}') self._generated_files_path = self._intermediate_output / 'src' - self._json = json if isinstance(json, Dotty) else dotty(json) + self._json = json.to_dict() if isinstance(json, Dotty) else json def __str__(self): return f'{self.keyboard}:{self.keymap}' @@ -52,9 +52,13 @@ def json(self) -> dict: if not self._json: self._load_json() if not self._json: - return dotty({}) + return {} return self._json + @property + def dotty(self) -> Dotty: + return dotty(self.json) + def _common_make_args(self, dry_run: bool = False, build_target: str = None): compile_args = [ find_make(), @@ -131,7 +135,7 @@ def __repr__(self): return f'KeyboardKeymapTarget(keyboard={self.keyboard}, keymap={self.keymap})' def _load_json(self): - self._json = dotty(keymap_json(self.keyboard, self.keymap)) + self._json = keymap_json(self.keyboard, self.keymap) def prepare_build(self, build_target: str = None, dry_run: bool = False, **env_vars) -> None: pass diff --git a/lib/python/qmk/cli/find.py b/lib/python/qmk/cli/find.py index dab088d78ac1..55a053009248 100644 --- a/lib/python/qmk/cli/find.py +++ b/lib/python/qmk/cli/find.py @@ -24,4 +24,4 @@ def find(cli): print(f'{target}') for key in cli.args.print: - print(f' {key}={target.json.get(key, None)}') + print(f' {key}={target.dotty.get(key, None)}')