Browse files

Fixed a documentation error. This fixes #143

  • Loading branch information...
1 parent 858806d commit 2ac1b7d4388209d8e1309ed5b43ebe8d023eaa53 @mitsuhiko mitsuhiko committed Nov 19, 2010
Showing with 10 additions and 3 deletions.
  1. +10 −3 docs/signals.rst
@@ -81,16 +81,23 @@ context are appended to it.
Additionally there is a convenient helper method
(:meth:`~blinker.base.Signal.connected_to`). that allows you to
temporarily subscribe a function to a signal with is a context manager on
-its own which simplifies the example above::
+its own. Because the return value of the context manager cannot be
+specified that way one has to pass the list in as argument::
from flask import template_rendered
- def captured_templates(app):
- recorded = []
+ def captured_templates(app, recorded):
def record(sender, template, context):
recorded.append((template, context))
return template_rendered.connected_to(record, app)
+The example above would then look like this::
+ templates = []
+ with captured_templates(app, templates):
+ ...
+ template, context = templates[0]
.. admonition:: Blinker API Changes
The :meth:`~blinker.base.Signal.connected_to` method arrived in Blinker

0 comments on commit 2ac1b7d

Please sign in to comment.