"""Theming aware template loaders."""fromdjango.template.loaders.filesystemimportLoaderasFilesystemLoaderfromedxmako.makoloaderimportMakoLoaderfromopenedx.core.djangoapps.theming.helpersimportget_template_path_with_themeclassThemeTemplateLoader(MakoLoader):""" This is a Django loader object which will load the template based on current request and its corresponding theme. """def__call__(self,template_name,template_dirs=None):template_name=get_template_path_with_theme(template_name).lstrip("/")returnself.load_template(template_name,template_dirs)classThemeFilesystemLoader(ThemeTemplateLoader):""" Filesystem Template loaders to pickup templates from theme directory based on the current site. """is_usable=True_accepts_engine_in_init=Truedef__init__(self,*args):ThemeTemplateLoader.__init__(self,FilesystemLoader(*args))