Deepak Kodihalli | 8457f82 | 2016-11-29 06:05:39 -0600 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | |
| 3 | import os |
| 4 | import yaml |
| 5 | from mako.template import Template |
| 6 | |
| 7 | if __name__ == '__main__': |
| 8 | script_dir = os.path.dirname(os.path.realpath(__file__)) |
| 9 | with open(os.path.join(script_dir, 'writefru.yaml'), 'r') as fd: |
| 10 | yamlDict = yaml.safe_load(fd) |
| 11 | |
| 12 | # Render the mako template |
| 13 | template = os.path.join(script_dir, 'writefru.mako.hpp') |
| 14 | t = Template(filename=template) |
| 15 | with open('writefru.hpp', 'w') as fd: |
| 16 | fd.write( |
| 17 | t.render( |
| 18 | fruDict=yamlDict)) |