def add_lookup(namespace, directory, package=None, prepend=False):
 templates = LOOKUP.get(namespace)
 if (not templates):
  LOOKUP[namespace] = templates = DynamicTemplateLookup(module_directory=settings.MAKO_MODULE_DIR, output_encoding='utf-8', input_encoding='utf-8', default_filters=['decode.utf8'], encoding_errors='replace')
 if package:
  directory = pkg_resources.resource_filename(package, directory)
 templates.add_directory(directory, prepend=prepend)

def add_lookup ( namespace , directory , package = None , prepend = False ) : templates = LOOKUP . get ( namespace ) if ( not templates ) : LOOKUP [ namespace ] = templates = DynamicTemplateLookup ( module_directory = settings . MAKO_MODULE_DIR , output_encoding = 'utf-8' , input_encoding = 'utf-8' , default_filters = [ 'decode.utf8' ] , encoding_errors = 'replace' ) if package : directory = pkg_resources . resource_filename ( package , directory ) templates . add_directory ( directory , prepend = prepend )
adds a new mako template lookup directory to the given namespace .