Removed unused API get_template_loaders.
It was introduced in a recent refactoring so this isn't an issue. Then renamed _get_template_loaders to get_template_loaders.
This commit is contained in:
parent
572cdb4391
commit
544a716da8
|
@ -7,7 +7,7 @@ from django.utils.functional import cached_property
|
|||
from django.utils import lru_cache
|
||||
|
||||
from .base import Context, Template, TemplateDoesNotExist
|
||||
from .loaders.utils import _get_template_loaders
|
||||
from .loaders.utils import get_template_loaders
|
||||
|
||||
|
||||
_dirs_undefined = object()
|
||||
|
@ -54,7 +54,7 @@ class Engine(object):
|
|||
|
||||
@cached_property
|
||||
def template_loaders(self):
|
||||
return _get_template_loaders(self.loaders)
|
||||
return get_template_loaders(self.loaders)
|
||||
|
||||
def find_template(self, name, dirs=None):
|
||||
# Inner import to avoid circular dependency
|
||||
|
|
|
@ -9,7 +9,7 @@ from django.template.loader import get_template_from_string, make_origin
|
|||
from django.utils.encoding import force_bytes
|
||||
|
||||
from .base import Loader as BaseLoader
|
||||
from .utils import _get_template_loaders
|
||||
from .utils import get_template_loaders
|
||||
|
||||
|
||||
class Loader(BaseLoader):
|
||||
|
@ -20,7 +20,7 @@ class Loader(BaseLoader):
|
|||
self.find_template_cache = {}
|
||||
# Use the private, non-caching version of get_template_loaders
|
||||
# in case loaders isn't hashable.
|
||||
self.loaders = _get_template_loaders(loaders)
|
||||
self.loaders = get_template_loaders(loaders)
|
||||
|
||||
def cache_key(self, template_name, template_dirs):
|
||||
if template_dirs:
|
||||
|
|
|
@ -1,25 +1,17 @@
|
|||
import warnings
|
||||
|
||||
from django.conf import settings
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.utils import lru_cache
|
||||
from django.utils import six
|
||||
from django.utils.module_loading import import_string
|
||||
|
||||
|
||||
@lru_cache.lru_cache()
|
||||
def get_template_loaders():
|
||||
return _get_template_loaders(settings.TEMPLATE_LOADERS)
|
||||
|
||||
|
||||
def _get_template_loaders(template_loaders=None):
|
||||
def get_template_loaders(template_loaders):
|
||||
loaders = []
|
||||
for template_loader in template_loaders:
|
||||
loader = find_template_loader(template_loader)
|
||||
if loader is not None:
|
||||
loaders.append(loader)
|
||||
# Immutable return value because it will be cached and shared by callers.
|
||||
return tuple(loaders)
|
||||
return loaders
|
||||
|
||||
|
||||
def find_template_loader(loader):
|
||||
|
|
Loading…
Reference in New Issue