routes.py.j2 734 B

12345678910111213141516171819202122
  1. {{ constants.GPL2_HEADER_SH_LIKE }}
  2. {{ constants.GENERATED_HEADER_SH_LIKE }}
  3. class XAPRouteError(Exception):
  4. pass
  5. class XAPRoutes():
  6. {% for id, route in xap.routes | dictsort %}
  7. {% if route.routes %}
  8. # {{route.define}}
  9. {% for subid, subroute in route.routes | dictsort %}
  10. {{route.define}}_{{subroute.define}} = b'\x{{ '%02d' % id|int(base=16) }}\x{{ '%02d' % subid|int(base=16) }}'
  11. {% if subroute.routes %}
  12. {% for subsubid, subsubroute in subroute.routes | dictsort %}
  13. {{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) }}'
  14. {% endfor %}
  15. {% endif %}
  16. {% endfor %}
  17. {% endif %}
  18. {% endfor %}
  19. # noqa: W391