On Feb 7, 2012, at 5:54 PM, Christian Wutte wrote:
> Hello there,
> I have another question: is it possible to set the output filename
> independently from the template file?
sure, Template accepts a parameter module_filename that overrides the filename, and TemplateLookup accepts a parameter modulename_callable so that you can pass a function which applies a naming scheme to all templates.
def name_module(source_path, uri):
return os.path.abspath(
os.path.join(
os.path.normpath("/var/tmp"),
uri + ".py"
)
)
lookup = TemplateLookup(directories="/foo/bar", modulename_callable=name_module)
docs:
http://docs.makotemplates.org/en/latest/usage.html#mako.lookup.Templa...
http://docs.makotemplates.org/en/latest/usage.html#mako.template.Temp...
> Thank you, BR,
> Christian
> --
> You received this message because you are subscribed to the Google Groups "Mako Templates for Python" group.
> To post to this group, send email to mako-discuss@googlegroups.com.
> To unsubscribe from this group, send email to mako-discuss+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mako-discuss?hl=en.