Skip to content
Myr

Record blueprint registration order.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent 750ab16 · Browse files · 3 files+14 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+14 added−3 removed

  • other:+14 added−3 removed

3 files+14 added−3 removed

modified:flask/app.py+9 added
470 unmodified lines
471 #: you how often they got attached.472 #:473 #: .. versionadded:: 0.7474 self.blueprints = {}475 self._blueprint_order = []476477 #: a place where extensions can store application specific state. For478 #: example this is where an extension could store database engines and479 #: similar things. For backwards compatibility extensions should register
423 unmodified lines
903 'are created on the fly need unique names.' % \904 (blueprint, self.blueprints[blueprint.name], blueprint.name)905 else:906 self.blueprints[blueprint.name] = blueprint907 self._blueprint_order.append(blueprint)908 first_registration = True909 blueprint.register(self, options, first_registration)910911 def iter_blueprints(self):912 """Iterates over all blueprints by the order they were registered.913914 .. versionadded:: 1.0915 """916 return iter(self._blueprint_order)917918 @setupmethod919 def add_url_rule(self, rule, endpoint=None, view_func=None, **options):920 """Connects a URL rule. Works exactly like the :meth:`route`921 decorator. If a view_func is provided it will be registered with the
968 unmodified lines
modified:flask/templating.py+2 added-3 removed
11 unmodified lines
12 TemplateNotFound1314from .globals import _request_ctx_stack, _app_ctx_stack15from .signals import template_rendered16from ._compat import itervalues, iteritems161718def _default_template_ctx_processor():19 """Default template context processor. Injects `request`,
59 unmodified lines
79 loader = self.app.jinja_loader80 if loader is not None:81 yield self.app, loader8284 for blueprint in itervalues(self.app.blueprints):83 for blueprint in self.app.iter_blueprints():84 loader = blueprint.jinja_loader85 if loader is not None:86 yield blueprint, loader87
2 unmodified lines
90 loader = self.app.jinja_loader91 if loader is not None:92 result.update(loader.list_templates())9395 for name, blueprint in iteritems(self.app.blueprints):94 for blueprint in self.app.iter_blueprints():95 loader = blueprint.jinja_loader96 if loader is not None:97 for template in loader.list_templates():98 result.add(template)
40 unmodified lines
modified:CHANGES+3 added
42 unmodified lines
43- Removed deprecate module functionality.44- Added the ``EXPLAIN_TEMPLATE_LOADING`` config flag which when enabled will45 instruct Flask to explain how it locates templates. This should help46 users debug when the wrong templates are loaded.47- Enforce blueprint handling in the order they were registered for template48 loading.495051Version 0.10.252--------------5354(bugfix release, release date to be announced)
477 unmodified lines