(self, template_path, template_dir)
return template
Get a compiled django template.

    Args:
      template_path: Full path to the template.
      template_dir: The root of the template path.
    Returns:
      A compiled django template.
Get a compiled django template.
Get a compiled django template .
def GetTemplate(self, template_path, template_dir):
    """Get a compiled django template.

    Args:
      template_path: Full path to the template.
      template_dir: The root of the template path.
    Returns:
      A compiled django template.
    """
    relpath = os.path.relpath(template_path, template_dir)
    if (self.UNSTABLE_VARIATION_PATTERN.match(relpath) or
        os.environ.get('NOCACHE')):
      # don't cache if specifically requested (for testing) or
      # for unstable variations
      return self._LoadTemplate(template_path)

    template = self._cache.get(template_path)
    if not template:
      try:
        template = self._LoadTemplate(template_path)
        self._cache[template_path] = template
      except django_template.TemplateSyntaxError as err:
        raise django_template.TemplateSyntaxError('%s: %s' % (relpath, err))
    return template
def GetTemplate ( self , template_path , template_dir ) : relpath = os . path . relpath ( template_path , template_dir ) if ( self . UNSTABLE_VARIATION_PATTERN . match ( relpath ) or os . environ . get ( 'NOCACHE' ) ) : # don't cache if specifically requested (for testing) or # for unstable variations return self . _LoadTemplate ( template_path ) template = self . _cache . get ( template_path ) if not template : try : template = self . _LoadTemplate ( template_path ) self . _cache [ template_path ] = template except django_template . TemplateSyntaxError as err : raise django_template . TemplateSyntaxError ( '%s: %s' % ( relpath , err ) ) return template