utils: codegen: gen-controls.py: Convert to jinja2 templates

Jinja2 templates help separate the logic related to the template from
the generation of the data. The python code becomes much clearer as a
result.

As an added bonus, we can use a single template file for both controls
and properties.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
This commit is contained in:
Laurent Pinchart
2024-08-16 00:27:54 +03:00
parent 48f9660acd
commit dc067c4bce
7 changed files with 175 additions and 340 deletions
+1 -1
View File
@@ -80,7 +80,7 @@ foreach mode, entry : controls_map
properties_files_names += files_list
endif
template_file = files(outfile + '.in')
template_file = files('control_ids.h.in')
ranges_file = files('../../src/libcamera/control_ranges.yaml')
control_headers += custom_target(header + '_h',
input : input_files,