forked from orbit-oss/flask
Latest iteration of the blueprint code. Far from being done
This commit is contained in:
parent
673fa18e6d
commit
7a08331ac0
8 changed files with 304 additions and 274 deletions
|
|
@ -14,6 +14,7 @@ from jinja2 import BaseLoader, Environment as BaseEnvironment, \
|
|||
|
||||
from .globals import _request_ctx_stack
|
||||
from .signals import template_rendered
|
||||
from .module import blueprint_is_module
|
||||
|
||||
|
||||
def _default_template_ctx_processor():
|
||||
|
|
@ -74,7 +75,9 @@ class DispatchingJinjaLoader(BaseLoader):
|
|||
loader = None
|
||||
try:
|
||||
module, name = posixpath.normpath(template).split('/', 1)
|
||||
loader = self.app.modules[module].jinja_loader
|
||||
blueprint = self.app.blueprints[module]
|
||||
if blueprint_is_module(blueprint):
|
||||
loader = blueprint.jinja_loader
|
||||
except (ValueError, KeyError, TemplateNotFound):
|
||||
pass
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue