mako 

Send to Kindle
home » snippets » python » mako



Notes

def create_mako_lookup(self, **kargs):
  directories=self.config_root.mako.directories
  extra_directories = kargs.pop("extra_directories", None)
  if extra_directories:
    directories.extend(extra_directories)

  lookup_args = dict(
      strict_undefined=True,
      directories=directories,
      filesystem_checks=True,
      input_encoding='utf-8',
      output_encoding='utf-8',
      encoding_errors='replace',
      format_exceptions=True)
  lookup_args.update(kargs)

  import mako.lookup
  return mako.lookup.TemplateLookup(**lookup_args)