trick/libexec/trick/create_top_dot_i
2017-03-27 15:19:43 -05:00

21 lines
506 B
Python
Executable File

#!/usr/bin/python
import os
with open('build/CP_instances') as cp_instances:
with open('build/top.i', 'w') as top:
path = os.path.abspath(os.getcwd())
instances = ''.join(cp_instances.readlines())
top.write(
'%module top\n'
'\n'
'%{\n'
'#include "../S_source.hh"\n'
'\n' +
instances + '\n'
'%}\n'
'\n'
'%import "build' + path + '/S_source_py.i"\n'
'\n' +
instances)