From de5c30a9bab0b1ebf97578931fad4ffe2ee00197 Mon Sep 17 00:00:00 2001 From: Zach White Date: Sun, 16 May 2021 11:06:57 -0700 Subject: Use milc.subcommand.config instead of qmk.cli.config (#12915) * Use milc.subcommand.config instead * pyformat * remove the config test --- lib/python/qmk/cli/__init__.py | 3 +- lib/python/qmk/cli/config.py | 116 ------------------------------ lib/python/qmk/tests/test_cli_commands.py | 6 -- 3 files changed, 1 insertion(+), 124 deletions(-) delete mode 100644 lib/python/qmk/cli/config.py (limited to 'lib') diff --git a/lib/python/qmk/cli/__init__.py b/lib/python/qmk/cli/__init__.py index 3face93a53..02b721f342 100644 --- a/lib/python/qmk/cli/__init__.py +++ b/lib/python/qmk/cli/__init__.py @@ -12,7 +12,6 @@ from subprocess import run from milc import cli, __VERSION__ from milc.questions import yesno - import_names = { # A mapping of package name to importable name 'pep8-naming': 'pep8ext_naming', @@ -154,7 +153,7 @@ from . import cformat # noqa from . import chibios # noqa from . import clean # noqa from . import compile # noqa -from . import config # noqa +from milc.subcommand import config # noqa from . import console # noqa from . import docs # noqa from . import doctor # noqa diff --git a/lib/python/qmk/cli/config.py b/lib/python/qmk/cli/config.py deleted file mode 100644 index e17d8bb9ba..0000000000 --- a/lib/python/qmk/cli/config.py +++ /dev/null @@ -1,116 +0,0 @@ -"""Read and write configuration settings -""" -from milc import cli - - -def print_config(section, key): - """Print a single config setting to stdout. - """ - cli.echo('%s.%s{fg_cyan}={fg_reset}%s', section, key, cli.config[section][key]) - - -def show_config(): - """Print the current configuration to stdout. - """ - for section in cli.config: - for key in cli.config[section]: - print_config(section, key) - - -def parse_config_token(config_token): - """Split a user-supplied configuration-token into its components. - """ - section = option = value = None - - if '=' in config_token and '.' not in config_token: - cli.log.error('Invalid configuration token, the key must be of the form
.