From aa97f52963f3da6aa112093d357296e62bfa5452 Mon Sep 17 00:00:00 2001 From: Zach White Date: Mon, 24 May 2021 23:36:38 -0700 Subject: [PATCH] Use milc.subcommand.config instead of qmk.cli.config (#13002) * Use milc.subcommand.config instead * pyformat * remove the config test --- lib/python/qmk/cli/__init__.py | 2 +- lib/python/qmk/cli/config.py | 116 ---------------------- lib/python/qmk/tests/test_cli_commands.py | 6 -- 3 files changed, 1 insertion(+), 123 deletions(-) delete mode 100644 lib/python/qmk/cli/config.py diff --git a/lib/python/qmk/cli/__init__.py b/lib/python/qmk/cli/__init__.py index 6fe769fe7b..be5ba90ad7 100644 --- a/lib/python/qmk/cli/__init__.py +++ b/lib/python/qmk/cli/__init__.py @@ -140,7 +140,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 docs # noqa from . import doctor # noqa from . import fileformat # 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
.