Skip to content
Myr

Fixed a documentation error. This fixes #143

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 858806d · Browse files · 1 file+10 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+10 added−3 removed

  • other:+10 added−3 removed

1 file+10 added−3 removed

modified:docs/signals.rst+10 added-3 removed
79 unmodified lines
8081Additionally there is a convenient helper method82(:meth:`~blinker.base.Signal.connected_to`). that allows you to83temporarily subscribe a function to a signal with is a context manager on84its own which simplifies the example above::84its own. Because the return value of the context manager cannot be85specified that way one has to pass the list in as argument::8687 from flask import template_rendered8888 def captured_templates(app):89 recorded = []89 def captured_templates(app, recorded):90 def record(sender, template, context):91 recorded.append((template, context))92 return template_rendered.connected_to(record, app)9394The example above would then look like this::9596 templates = []97 with captured_templates(app, templates):98 ...99 template, context = templates[0]100101.. admonition:: Blinker API Changes102103 The :meth:`~blinker.base.Signal.connected_to` method arrived in Blinker104 with version 1.1.
135 unmodified lines