Code cleanup, use pathlib, use pytest keyboard

Clean up checks and logics that are unnecessary due to MILC updates.
Use pathlib instead of os.path for readability.
Use the 'pytest' keyboard for the tests.
Add community layout for 'handwired/onekey/pytest' so we can test
community layouts.
This commit is contained in:
Erovia authored and skullydazed committed 2020-02-15 15:19:03 -08:00
1 parent 8eeab1112a
commit 3db41817e0
7 files changed
+30 -32

No files matched your search

+3 -7
View File
@@ -10,17 +10,13 @@ from qmk.errors import NoSuchKeyboardError
def list_keymaps(cli):
"""List the keymaps for a specific keyboard
"""
# ask for user input if keyboard was not provided in the command line
if cli.args.keyboard:
cli.config.list_keymaps.keyboard = cli.args.keyboard
elif not cli.config.list_keymaps.keyboard:
cli.config.list_keymaps.keyboard = input("Keyboard Name: ")
try:
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('%s:%s', cli.config.list_keymaps.keyboard, name)
cli.echo('%s', name)
except NoSuchKeyboardError as e:
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)
except TypeError:
cli.echo("{fg_red}Something went wrong. Did you specify a keyboard?")