def format(self, values):
"""Format the payload.
This format the vector payloads using Mako template.
Also set a TemplateLookup to the template folder, to allow an easy
`<% include>` tag usage.
Args:
values (dict): The values passed as arguments of Mako
`template.Template(arg[n]).render(**values)`
Returns:
A list of string containing the formatted payloads.
"""
return [
Template(
text = arg,
lookup = TemplateLookup(directories = [ self.folder ])
).render(**values)
for arg in self.arguments
]
评论列表
文章目录