aboutsummaryrefslogtreecommitdiffstats
path: root/lib/python/qmk/cli
diff options
context:
space:
mode:
authorGravatar Erovia <erovia@users.noreply.github.com>2019-10-24 20:33:58 +0200
committerGravatar skullydazed <skullydazed@users.noreply.github.com>2020-02-15 15:19:03 -0800
commit3ed1223678d3ec40f4cceecd320dd1112cdfb157 (patch)
treeaba0df6ac06a6e8632b1a24fe55c0a392e841394 /lib/python/qmk/cli
parentd257a98cb80a90f116072c882753039b10a5e042 (diff)
downloadqmk_firmware-3ed1223678d3ec40f4cceecd320dd1112cdfb157.tar.gz
Drop bs4 dependency, update docs, minor improvements
Diffstat (limited to 'lib/python/qmk/cli')
-rw-r--r--lib/python/qmk/cli/list/keymaps.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/python/qmk/cli/list/keymaps.py b/lib/python/qmk/cli/list/keymaps.py
index 494fe66a1..a17c6a913 100644
--- a/lib/python/qmk/cli/list/keymaps.py
+++ b/lib/python/qmk/cli/list/keymaps.py
@@ -10,11 +10,14 @@ def list_keymaps(cli):
"""List the keymaps for a specific keyboard
"""
# ask for user input if keyboard was not provided in the command line
- keyboard_name = cli.config.list_keymaps.keyboard if cli.config.list_keymaps.keyboard else input("Keyboard Name: ")
+ if not cli.config.list_keymaps.keyboard:
+ cli.config.list_keymaps.keyboard = input("Keyboard Name: ")
try:
- for name in qmk.keymap.list_keymaps(keyboard_name):
+ for name in qmk.keymap.list_keymaps(cli.config.list_keymaps.keyboard):
# We echo instead of cli.log.info to allow easier piping of this output
- cli.echo(keyboard_name + ":" + name)
+ cli.echo('%s:%s', cli.config.list_keymaps.keyboard, name)
except NoSuchKeyboardError as e:
- cli.echo("{fg_red}" + e.message)
+ cli.echo("{fg_red}%s: %s", cli.config.list_keymaps.keyboard, e.message)
+ except (FileNotFoundError, PermissionError) as e:
+ cli.echo("{fg_red}%s: %s", cli.config.list_keymaps.keyboard, e)