qmk_firmware/data/templates/xap/client/python/routes.py.j2

20 lines
730 B
Plaintext
Raw Normal View History

{{ constants.GPL2_HEADER_SH_LIKE }}
{{ constants.GENERATED_HEADER_SH_LIKE }}
2022-07-17 22:04:35 +00:00
class XAPRouteError(Exception):
pass
2022-07-17 21:02:18 +00:00
class XAPRoutes():
2022-07-17 01:58:14 +00:00
{%- for id, route in xap.routes | dictsort %}
{%- if route.routes %}
2022-07-17 21:02:18 +00:00
# {{route.define}}
2022-07-17 01:58:14 +00:00
{%- for subid, subroute in route.routes | dictsort %}
2022-07-17 21:02:18 +00:00
{{route.define}}_{{subroute.define}} = b'\x{{ '%02d' % id|int(base=16) }}\x{{ '%02d' % subid|int(base=16) }}'
2022-09-26 00:09:15 +00:00
{%- if subroute.routes %}
{%- for subsubid, subsubroute in subroute.routes | dictsort %}
{{route.define}}_{{subroute.define}}_{{subsubroute.define}} = b'\x{{ '%02d' % id|int(base=16) }}\x{{ '%02d' % subid|int(base=16) }}\x{{ '%02d' % subsubid|int(base=16) }}'
{%- endfor %}
{%- endif %}
2022-07-17 01:58:14 +00:00
{%- endfor %}
{%- endif %}
{%- endfor %}