From a76e99959ecc3220c317cb2942332a9fc342f3a4 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 2 Nov 2010 02:32:02 -0400 Subject: - New event type: ``pyramid.interfaces.IBeforeRender``. An object of this type is sent as an event before a renderer is invoked (but after the application-level renderer globals factory added via ``pyramid.configurator.configuration.set_renderer_globals_factory``, if any, has injected its own keys). Applications may now subscribe to the ``IBeforeRender`` event type in order to introspect the and modify the set of renderer globals before they are passed to a renderer. The event object iself has a dictionary-like interface that can be used for this purpose. For example:: from repoze.events import subscriber from pyramid.interfaces import IRendererGlobalsEvent @subscriber(IRendererGlobalsEvent) def add_global(event): event['mykey'] = 'foo' If a subscriber attempts to add a key that already exist in the renderer globals dictionary, a ``KeyError`` is raised. This limitation is due to the fact that subscribers cannot be ordered relative to each other. The set of keys added to the renderer globals dictionary by all subscribers and app-level globals factories must be unique. --- TODO.txt | 2 -- 1 file changed, 2 deletions(-) (limited to 'TODO.txt') diff --git a/TODO.txt b/TODO.txt index 56038e3c0..dfb0a1712 100644 --- a/TODO.txt +++ b/TODO.txt @@ -76,8 +76,6 @@ - Try to get rid of Mako Beaker dependency. -- Maybe make renderer globals lookup send an event? - - ``docs`` directory for each paster template. - bfg.routes.matchdict and bfg.routes.route -- cgit v1.2.3