-
-
Notifications
You must be signed in to change notification settings - Fork 39.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
89 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from milc import cli | ||
|
||
from qmk.importers import import_kbfirmware as _import_kbfirmware | ||
from qmk.path import FileType | ||
from qmk.json_schema import json_load | ||
|
||
|
||
@cli.argument('filename', type=FileType('r'), nargs='+', arg_only=True, help='file') | ||
@cli.subcommand('Import kbfirmware json export') | ||
def import_kbfirmware(cli): | ||
filename = cli.args.filename[0] | ||
|
||
data = json_load(filename) | ||
|
||
cli.log.info(f'{{style_bright}}Importing {filename.name}.{{style_normal}}') | ||
cli.echo('') | ||
|
||
cli.log.warn("Support here is basic - Consider using 'qmk new-keyboard' instead") | ||
|
||
kb_name = _import_kbfirmware(data) | ||
|
||
cli.log.info(f'{{fg_green}}Imported a new keyboard named {{fg_cyan}}{kb_name}{{fg_green}}.{{fg_reset}}') | ||
cli.log.info(f'To start working on things, `cd` into {{fg_cyan}}keyboards/{kb_name}{{fg_reset}},') | ||
cli.log.info('or open the directory in your preferred text editor.') | ||
cli.log.info(f"And build with {{fg_yellow}}qmk compile -kb {kb_name} -km default{{fg_reset}}.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from milc import cli | ||
|
||
from qmk.importers import import_keyboard as _import_keyboard | ||
from qmk.path import FileType | ||
from qmk.json_schema import json_load | ||
|
||
|
||
@cli.argument('filename', type=FileType('r'), nargs='+', arg_only=True, help='file') | ||
@cli.subcommand('Import data-driven keyboard') | ||
def import_keyboard(cli): | ||
filename = cli.args.filename[0] | ||
|
||
data = json_load(filename) | ||
|
||
cli.log.info(f'{{style_bright}}Importing {filename.name}.{{style_normal}}') | ||
cli.echo('') | ||
|
||
kb_name = _import_keyboard(data) | ||
|
||
cli.log.info(f'{{fg_green}}Imported a new keyboard named {{fg_cyan}}{kb_name}{{fg_green}}.{{fg_reset}}') | ||
cli.log.info(f'To start working on things, `cd` into {{fg_cyan}}keyboards/{kb_name}{{fg_reset}},') | ||
cli.log.info('or open the directory in your preferred text editor.') | ||
cli.log.info(f"And build with {{fg_yellow}}qmk compile -kb {kb_name} -km default{{fg_reset}}.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from milc import cli | ||
|
||
from qmk.importers import import_keymap as _import_keymap | ||
from qmk.path import FileType | ||
from qmk.json_schema import json_load | ||
|
||
|
||
@cli.argument('filename', type=FileType('r'), nargs='+', arg_only=True, help='file') | ||
@cli.subcommand('Import data-driven keymap') | ||
def import_keymap(cli): | ||
filename = cli.args.filename[0] | ||
|
||
data = json_load(filename) | ||
|
||
cli.log.info(f'{{style_bright}}Importing {filename.name}.{{style_normal}}') | ||
cli.echo('') | ||
|
||
kb_name = _import_keymap(data) | ||
|
||
cli.log.info(f'{{fg_green}}Imported a new keymap named {{fg_cyan}}{km_name}{{fg_green}}.{{fg_reset}}') | ||
cli.log.info(f'To start working on things, `cd` into {{fg_cyan}}keyboards/{kb_name}/keymaps/{km_name}{{fg_reset}},') | ||
cli.log.info('or open the directory in your preferred text editor.') | ||
cli.log.info(f"And build with {{fg_yellow}}qmk compile -kb {kb_name} -km {km_name}{{fg_reset}}.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters