1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-26 13:21:03 +03:00

Rev 1.0 of Driver Wrappers code gen

The psa_crypto_driver_wrappers.c is merely rendered with no real
templating in version 1.0.

Signed-off-by: Archana <archana.madhavan@silabs.com>
This commit is contained in:
Archana
2021-11-17 08:44:07 +05:30
parent 68eb2ac960
commit 1f1a34a226
5 changed files with 2414 additions and 7 deletions

View File

@ -0,0 +1,27 @@
#!/usr/bin/env python3
import sys
import json
import os
import jinja2
def render(tpl_path):
path, filename = os.path.split(tpl_path)
return jinja2.Environment(
loader=jinja2.FileSystemLoader(path or './')
).get_template(filename).render()
n = len(sys.argv)
if ( n != 3 ):
sys.exit("The template file name and output file name are expected as arguments")
# set template file name, output file name
driver_wrapper_template_filename = sys.argv[1]
driver_wrapper_output_filename = sys.argv[2]
# render the template
result = render(driver_wrapper_template_filename)
# write output to file
outFile = open(driver_wrapper_output_filename,"w")
outFile.write(result)
outFile.close()