def render_source(output_dir, package_spec):
path, name = package_spec.filepath<EOL>module_prefix = "<STR_LIT>"<EOL>module_name = camel_case(name)<EOL>full_module_name = "<STR_LIT:.>".join([module_prefix, module_name])<EOL>destination_filename = "<STR_LIT>" % (output_dir, module_name)<EOL>py_template = JENV.get_template(MESSAGES_TEMPLATE_NAME)<EOL>module_includes = ["<STR_LIT:.>".join([module_prefix] + [camel_case(j) for j in i.split("<STR_LIT:.>")[:-<NUM_LIT:1>]])<EOL>for i in package_spec.includes]<EOL>with open(destination_filename, '<STR_LIT:w>') as f:<EOL><INDENT>f.write(py_template.render(msgs=package_spec.definitions,<EOL>description=package_spec.description,<EOL>module_name=full_module_name,<EOL>module_includes=module_includes))<EOL><DEDENT>
Render and output to a directory given a package specification.