class_docstr: A loader that is passed a function which does the loading.  The
  function receives the name of the template and has to return either
  an unicode string with the template source, a tuple in the form ``(source,
  filename, uptodatefunc)`` or `None` if the template does not exist.
  
  >>> def load_template(name):
  ...     if name == 'index.html':
  ...         return '...'
  ...
  >>> loader = FunctionLoader(load_template)
  
  The `uptodatefunc` is a function that is called if autoreload is enabled
  and has to return `True` if the template is still up to date.  For more
  details have a look at :meth:`BaseLoader.get_source` which has the same
  return value.
class_docstr_tok: ["A","loader","that","is","passed","a","function","which","does","the","loading",".","The","function","receives","the","name","of","the","template","and","has","to","return","either","an","unicode","string","with","the","template","source",",","a","tuple","in","the","form","``","(","source",",","filename",",","uptodatefunc",")","``","or","`","None","`","if","the","template","does","not","exist",".",">",">",">","def","load_template","(","name",")",":","...","if","name","==","'index.html","'",":","...","return","'","...","'","...",">",">",">","loader","=","FunctionLoader","(","load_template",")","The","`","uptodatefunc","`","is","a","function","that","is","called","if","autoreload","is","enabled","and","has","to","return","`","True","`","if","the","template","is","still","up","to","date",".","For","more","details","have","a","look","at",":","meth",":","`","BaseLoader.get_source","`","which","has","the","same","return","value","."]
code: def __init__(self, load_func):
      self.load_func = load_func
  
imports: import os
  import sys
  import weakref
  from hashlib import sha1
  from os import path
  from types import ModuleType
  from ._compat import abc
  from ._compat import fspath
  from ._compat import iteritems
  from ._compat import string_types
  from .exceptions import TemplateNotFound
  from .utils import internalcode
  from .utils import open_if_exists
label_desc: Use image node_id 1 to create a new FunctionLoader object from inherited base classes: BaseLoader with example: obj = FunctionLoader(load_func)