Rebase on master, hide some other subcommands
The list of hidden subcommands were approved by @skullydazed ;) Currently hidden if 'user.developer' is not True: - cformat - docs - kle2json - pyformat - pytest
This commit is contained in:
2
bin/qmk
2
bin/qmk
@@ -24,7 +24,7 @@ def _check_modules(requirements):
|
|||||||
for line in fd.readlines():
|
for line in fd.readlines():
|
||||||
line = line.strip().replace('<', '=').replace('>', '=')
|
line = line.strip().replace('<', '=').replace('>', '=')
|
||||||
|
|
||||||
if len(line) == 0 or line[0] == '#' or '-r' in line:
|
if len(line) == 0 or line[0] == '#' or line.startswith('-r'):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if '#' in line:
|
if '#' in line:
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ def cformat_run(files, all_files):
|
|||||||
@cli.argument('-a', '--all-files', arg_only=True, action='store_true', help='Format all core files.')
|
@cli.argument('-a', '--all-files', arg_only=True, action='store_true', help='Format all core files.')
|
||||||
@cli.argument('-b', '--base-branch', default='origin/master', help='Branch to compare to diffs to.')
|
@cli.argument('-b', '--base-branch', default='origin/master', help='Branch to compare to diffs to.')
|
||||||
@cli.argument('files', nargs='*', arg_only=True, help='Filename(s) to format.')
|
@cli.argument('files', nargs='*', arg_only=True, help='Filename(s) to format.')
|
||||||
@cli.subcommand("Format C code according to QMK's style.")
|
@cli.subcommand("Format C code according to QMK's style.", hidden=True)
|
||||||
def cformat(cli):
|
def cformat(cli):
|
||||||
"""Format C code according to QMK's style.
|
"""Format C code according to QMK's style.
|
||||||
"""
|
"""
|
||||||
|
|||||||
25
lib/python/qmk/cli/docs.py
Normal file
25
lib/python/qmk/cli/docs.py
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
"""Serve QMK documentation locally
|
||||||
|
"""
|
||||||
|
import http.server
|
||||||
|
import os
|
||||||
|
|
||||||
|
from milc import cli
|
||||||
|
|
||||||
|
|
||||||
|
@cli.argument('-p', '--port', default=8936, type=int, help='Port number to use.')
|
||||||
|
@cli.subcommand('Run a local webserver for QMK documentation.', hidden=True)
|
||||||
|
def docs(cli):
|
||||||
|
"""Spin up a local HTTPServer instance for the QMK docs.
|
||||||
|
"""
|
||||||
|
os.chdir('docs')
|
||||||
|
|
||||||
|
with http.server.HTTPServer(('', cli.config.docs.port), http.server.SimpleHTTPRequestHandler) as httpd:
|
||||||
|
cli.log.info("Serving QMK docs at http://localhost:%d/", cli.config.docs.port)
|
||||||
|
cli.log.info("Press Control+C to exit.")
|
||||||
|
|
||||||
|
try:
|
||||||
|
httpd.serve_forever()
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
cli.log.info("Stopping HTTP server...")
|
||||||
|
finally:
|
||||||
|
httpd.shutdown()
|
||||||
@@ -26,7 +26,7 @@ class CustomJSONEncoder(json.JSONEncoder):
|
|||||||
|
|
||||||
@cli.argument('filename', help='The KLE raw txt to convert')
|
@cli.argument('filename', help='The KLE raw txt to convert')
|
||||||
@cli.argument('-f', '--force', action='store_true', help='Flag to overwrite current info.json')
|
@cli.argument('-f', '--force', action='store_true', help='Flag to overwrite current info.json')
|
||||||
@cli.subcommand('Convert a KLE layout to a Configurator JSON')
|
@cli.subcommand('Convert a KLE layout to a Configurator JSON', hidden=True)
|
||||||
def kle2json(cli):
|
def kle2json(cli):
|
||||||
"""Convert a KLE layout to QMK's layout format.
|
"""Convert a KLE layout to QMK's layout format.
|
||||||
""" # If filename is a path
|
""" # If filename is a path
|
||||||
|
|||||||
Reference in New Issue
Block a user