Stub out python client gen

This commit is contained in:
zvecr
2022-07-17 01:53:59 +01:00
parent 70eae6b348
commit 2a1bfafa1a
6 changed files with 87 additions and 12 deletions
+1
View File
@@ -80,6 +80,7 @@ subcommands = [
'qmk.cli.xap',
'qmk.cli.xap.generate_docs',
'qmk.cli.xap.generate_json',
'qmk.cli.xap.generate_python',
'qmk.cli.xap.generate_qmk',
]
+22
View File
@@ -0,0 +1,22 @@
"""This script generates the python XAP client.
"""
from qmk.constants import QMK_FIRMWARE, GPL2_HEADER_SH_LIKE, GENERATED_HEADER_SH_LIKE
from qmk.xap.common import latest_xap_defs, render_xap_output
from qmk.commands import dump_lines
from milc import cli
@cli.subcommand('Generates the python XAP client.', hidden=False if cli.config.user.developer else True)
def xap_generate_python(cli):
defs = latest_xap_defs()
parent = QMK_FIRMWARE / 'lib' / 'python' / 'xap_client'
for name in ['types.py']:
lines = [GPL2_HEADER_SH_LIKE, GENERATED_HEADER_SH_LIKE]
output = render_xap_output('client/python', f'{name}.j2', defs)
lines += output.split('\n')
dump_lines(parent / name, lines)
+1 -1
View File
@@ -102,7 +102,7 @@ class XAPShell(cmd.Cmd):
while 1:
(event, data) = self.device.listen()
if event == XAPEventType.SECURE:
if event == XAPEventType.SECURE_STATUS:
secure_status = XAPSecureStatus(data[0]).name
cli.log.info(' Secure[%s]', secure_status)