Update QMK CLI to be inline with upstream
This commit is contained in:
@@ -9,6 +9,7 @@ from milc import cli
|
||||
from . import cformat
|
||||
from . import compile
|
||||
from . import config
|
||||
from . import docs
|
||||
from . import doctor
|
||||
from . import flash
|
||||
from . import hello
|
||||
|
||||
@@ -43,8 +43,8 @@ def cformat(cli):
|
||||
# Empty array for files
|
||||
files = []
|
||||
# Core directories for formatting
|
||||
core_dirs = ['drivers', 'quantum', 'tests', 'tmk_core']
|
||||
ignores = ['tmk_core/protocol/usb_hid', 'quantum/template']
|
||||
core_dirs = ['drivers', 'quantum', 'tests', 'tmk_core', 'platforms']
|
||||
ignores = ['tmk_core/protocol/usb_hid', 'quantum/template', 'platforms/chibios']
|
||||
# Find the list of files to format
|
||||
if cli.args.files:
|
||||
files.extend(normpath(file) for file in cli.args.files)
|
||||
|
||||
@@ -4,6 +4,7 @@ You can compile a keymap already in the repo or using a QMK Configurator export.
|
||||
A bootloader must be specified.
|
||||
"""
|
||||
import subprocess
|
||||
from argparse import FileType
|
||||
|
||||
from milc import cli
|
||||
|
||||
@@ -26,6 +27,7 @@ def print_bootloader_help():
|
||||
cli.echo('\tdfu-util-split-left')
|
||||
cli.echo('\tdfu-util-split-right')
|
||||
cli.echo('\tst-link-cli')
|
||||
cli.echo('\tst-flash')
|
||||
cli.echo('For more info, visit https://docs.qmk.fm/#/flashing')
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import subprocess
|
||||
import shlex
|
||||
import shutil
|
||||
|
||||
from milc import cli
|
||||
import qmk.keymap
|
||||
|
||||
|
||||
@@ -37,7 +38,7 @@ def create_make_command(keyboard, keymap, target=None):
|
||||
return [make_cmd, ':'.join(make_args)]
|
||||
|
||||
|
||||
def compile_configurator_json(configurator_filename, bootloader=None):
|
||||
def compile_configurator_json(user_keymap, bootloader=None):
|
||||
"""Convert a configurator export JSON file into a C file
|
||||
|
||||
Args:
|
||||
@@ -52,9 +53,6 @@ def compile_configurator_json(configurator_filename, bootloader=None):
|
||||
|
||||
A command to run to compile and flash the C file.
|
||||
"""
|
||||
# Parse the configurator json
|
||||
user_keymap = parse_configurator_json(configurator_filename)
|
||||
|
||||
# Write the keymap C file
|
||||
qmk.keymap.write(user_keymap['keyboard'], user_keymap['keymap'], user_keymap['layout'], user_keymap['layers'])
|
||||
|
||||
@@ -86,4 +84,6 @@ def run(command, *args, **kwargs):
|
||||
safecmd = ' '.join(safecmd)
|
||||
command = [os.environ['SHELL'], '-c', safecmd]
|
||||
|
||||
cli.log.debug('Running command: %s', command)
|
||||
|
||||
return subprocess.run(command, *args, **kwargs)
|
||||
|
||||
@@ -77,7 +77,6 @@ def _extract_config_h(info_data):
|
||||
'device_ver': config_c.get('DEVICE_VER'),
|
||||
'manufacturer': config_c.get('MANUFACTURER'),
|
||||
'product': config_c.get('PRODUCT'),
|
||||
'description': config_c.get('DESCRIPTION'),
|
||||
}
|
||||
|
||||
return info_data
|
||||
|
||||
Reference in New Issue
Block a user