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

22 lines
734 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():
{% for id, route in xap.routes | dictsort %}
{% if route.routes %}
2022-07-17 21:02:18 +00:00
# {{route.define}}
{% 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) }}'
{% if subroute.routes %}
{% for subsubid, subsubroute in subroute.routes | dictsort %}
2022-09-26 00:09:15 +00:00
{{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 %}
{% endfor %}
{% endif %}
{% endfor %}
# noqa: W391