Skip to content
Myr

Fixed template_rendered example in signal documentation.

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

authored by Zhao Xiaohong · committed by Armin Ronacher · parent a3f78af · Browse files · 1 file+3 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

1 file+3 added−3 removed

  • other:+3 added−3 removed

1 file+3 added−3 removed

modified:docs/signals.rst+3 added-3 removed
53 unmodified lines
5455 @contextmanager56 def captured_templates(app):57 recorded = []58 def record(template, context):58 def record(sender, template, context):59 recorded.append((template, context))60 template_rendered.connect(record, app)61 try:62 yield recorded
23 unmodified lines
86 from flask import template_rendered8788 def captured_templates(app):89 recorded = []90 def record(template, context):90 def record(sender, template, context):91 recorded.append((template, context))92 return template_rendered.connected_to(record, app)9394.. admonition:: Blinker API Changes
59 unmodified lines
154155 from flask import template_rendered156157 @template_rendered.connect_via(app)158 def when_template_rendered(template, context):158 def when_template_rendered(sender, template, context):159 print 'Template %s is rendered with %s' % (template.name, context)160161Core Signals162------------
70 unmodified lines