parameters: (self, template_path)
return_statement: return env
docstring: 根据template_path创建相对应的Jinja2 Environment
docstring_summary: 根据template_path创建相对应的Jinja2 Environment
docstring_tokens: 根据template_path创建相对应的Jinja2 Environment
function: def create_template_loader(self, template_path):
          """根据template_path创建相对应的Jinja2 Environment"""
          temp_path = template_path
          if isinstance(template_path, (list, tuple)):
              temp_path = template_path[0]
  
          env = BaseHandler._path_to_env.get(temp_path)
          if not env:
              logging.debug("create template env for [%s]" % template_path)
              _loader = FileSystemLoader(template_path)
              env = Environment(loader=_loader)
              env.filters["day"] = day_format
              env.filters["website"] = website_format
              # env.globals['gettext'] = _
              BaseHandler._path_to_env[temp_path] = env
          return env
function_tokens: def create_template_loader ( self , template_path ) : temp_path = template_path if isinstance ( template_path , ( list , tuple ) ) : temp_path = template_path [ 0 ] env = BaseHandler . _path_to_env . get ( temp_path ) if not env : logging . debug ( "create template env for [%s]" % template_path ) _loader = FileSystemLoader ( template_path ) env = Environment ( loader = _loader ) env . filters [ "day" ] = day_format env . filters [ "website" ] = website_format # env.globals['gettext'] = _ BaseHandler . _path_to_env [ temp_path ] = env return env