From 36a421bb3a235f696131bc8a546492fc04a411f0 Mon Sep 17 00:00:00 2001 From: Zhao Xiaohong Date: Sun, 15 Aug 2010 10:52:11 +0800 Subject: [PATCH] Fixed template_rendered example in signal documentation. --- docs/signals.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/signals.rst b/docs/signals.rst index feb9a7b2..73a0c744 100644 --- a/docs/signals.rst +++ b/docs/signals.rst @@ -55,7 +55,7 @@ to the template:: @contextmanager def captured_templates(app): recorded = [] - def record(template, context): + def record(sender, template, context): recorded.append((template, context)) template_rendered.connect(record, app) try: @@ -87,7 +87,7 @@ its own which simplifies the example above:: def captured_templates(app): recorded = [] - def record(template, context): + def record(sender, template, context): recorded.append((template, context)) return template_rendered.connected_to(record, app) @@ -155,7 +155,7 @@ With Blinker 1.1 you can also easily subscribe to signals by using the new from flask import template_rendered @template_rendered.connect_via(app) - def when_template_rendered(template, context): + def when_template_rendered(sender, template, context): print 'Template %s is rendered with %s' % (template.name, context) Core Signals