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:
@@ -143,9 +143,10 @@ foreach mode, inout_files : controls_mode_files
|
||||
input_files = inout_files[0]
|
||||
output_file = inout_files[1]
|
||||
|
||||
template_file = files(output_file + '.in')
|
||||
template_file = files('control_ids.cpp.in')
|
||||
ranges_file = files('control_ranges.yaml')
|
||||
control_sources += custom_target(mode + '_cpp',
|
||||
|
||||
control_sources += custom_target(mode + '_ids_cpp',
|
||||
input : input_files,
|
||||
output : output_file,
|
||||
command : [gen_controls, '-o', '@OUTPUT@',
|
||||
|
||||
Reference in New Issue
Block a user