From 751316c34465ea77e066c3052729b207f3d62e0c Mon Sep 17 00:00:00 2001 From: Zach White Date: Tue, 26 May 2020 13:05:41 -0700 Subject: [CLI] Add a subcommand for getting information about a keyboard (#8666) You can now use `qmk info` to get information about keyboards and keymaps. Co-authored-by: Erovia --- lib/python/qmk/makefile.py | 32 -------------------------------- 1 file changed, 32 deletions(-) (limited to 'lib/python/qmk/makefile.py') diff --git a/lib/python/qmk/makefile.py b/lib/python/qmk/makefile.py index 8645056d2d..02c2e70050 100644 --- a/lib/python/qmk/makefile.py +++ b/lib/python/qmk/makefile.py @@ -2,8 +2,6 @@ """ from pathlib import Path -from qmk.errors import NoSuchKeyboardError - def parse_rules_mk_file(file, rules_mk=None): """Turn a rules.mk file into a dictionary. @@ -51,33 +49,3 @@ def parse_rules_mk_file(file, rules_mk=None): rules_mk[key.strip()] = value.strip() return rules_mk - - -def get_rules_mk(keyboard): - """ Get a rules.mk for a keyboard - - Args: - keyboard: name of the keyboard - - Raises: - NoSuchKeyboardError: when the keyboard does not exists - - Returns: - a dictionary with the content of the rules.mk file - """ - # Start with qmk_firmware/keyboards - kb_path = Path.cwd() / "keyboards" - # walk down the directory tree - # and collect all rules.mk files - kb_dir = kb_path / keyboard - if kb_dir.exists(): - rules_mk = dict() - for directory in Path(keyboard).parts: - kb_path = kb_path / directory - rules_mk_path = kb_path / "rules.mk" - if rules_mk_path.exists(): - rules_mk = parse_rules_mk_file(rules_mk_path, rules_mk) - else: - raise NoSuchKeyboardError("The requested keyboard and/or revision does not exist.") - - return rules_mk -- cgit v1.2.3