|
|
@ -8,6 +8,7 @@ |
|
|
|
:copyright: (c) 2010 by Armin Ronacher. |
|
|
|
:copyright: (c) 2010 by Armin Ronacher. |
|
|
|
:license: BSD, see LICENSE for more details. |
|
|
|
:license: BSD, see LICENSE for more details. |
|
|
|
""" |
|
|
|
""" |
|
|
|
|
|
|
|
import posixpath |
|
|
|
from jinja2 import BaseLoader, TemplateNotFound |
|
|
|
from jinja2 import BaseLoader, TemplateNotFound |
|
|
|
|
|
|
|
|
|
|
|
from .globals import _request_ctx_stack |
|
|
|
from .globals import _request_ctx_stack |
|
|
@ -36,6 +37,9 @@ class _DispatchingJinjaLoader(BaseLoader): |
|
|
|
self.app = app |
|
|
|
self.app = app |
|
|
|
|
|
|
|
|
|
|
|
def get_source(self, environment, template): |
|
|
|
def get_source(self, environment, template): |
|
|
|
|
|
|
|
template = posixpath.normpath(template) |
|
|
|
|
|
|
|
if template.startswith('../'): |
|
|
|
|
|
|
|
raise TemplateNotFound(template) |
|
|
|
loader = None |
|
|
|
loader = None |
|
|
|
try: |
|
|
|
try: |
|
|
|
module, name = template.split('/', 1) |
|
|
|
module, name = template.split('/', 1) |
|
|
|