def render_source(output_dir, package_spec, jenv=JENV):
path, name = package_spec.filepath<EOL>directory = output_dir<EOL>destination_filename = "<STR_LIT>" % (directory, name)<EOL>py_template = jenv.get_template(TEMPLATE_NAME)<EOL>module_path = "<STR_LIT:.>".join(package_spec.identifier.split("<STR_LIT:.>")[<NUM_LIT:1>:-<NUM_LIT:1>])<EOL>includes = ["<STR_LIT:.>".join(i.split("<STR_LIT:.>")[:-<NUM_LIT:1>]) for i in package_spec.includes]<EOL>includes = [i for i in includes if i != "<STR_LIT>"]<EOL>print(destination_filename, includes)<EOL>with open(destination_filename, '<STR_LIT:w>') as f:<EOL><INDENT>f.write(py_template.render(msgs=package_spec.definitions,<EOL>filepath="<STR_LIT:/>".join(package_spec.filepath) + "<STR_LIT>",<EOL>module_path=module_path,<EOL>include=includes,<EOL>timestamp=package_spec.creation_timestamp,<EOL>description=package_spec.description))<EOL><DEDENT>
Render and output