summaryrefslogtreecommitdiff
path: root/repoze/bfg/interfaces.py
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-09-20 22:13:11 +0000
committerChris McDonough <chrism@agendaless.com>2009-09-20 22:13:11 +0000
commite4610566d881f707c01d266a7e336084029c83e4 (patch)
tree0a2001361b14e5b0b7521164e67560e2763e4c3c /repoze/bfg/interfaces.py
parent160f01439dc3e0d865b2e77bb4a9a7c9e7a16c1a (diff)
downloadpyramid-e4610566d881f707c01d266a7e336084029c83e4.tar.gz
pyramid-e4610566d881f707c01d266a7e336084029c83e4.tar.bz2
pyramid-e4610566d881f707c01d266a7e336084029c83e4.zip
- The way ``bfg_view`` declarations are scanned for has been modified.
This should have no external effects. - An object implementing the ``IRenderer`` interface (and ``ITemplateRenderer`, which is a subclass of ``IRenderer``) must now accept an extra ``system`` argument in its ``__call__`` method implementation. Values computed by the system (as opposed to by the view) are passed by the system in the ``system`` parameter, which will always be a dictionary. Keys in the dictionary include: ``view`` (the view object that returned the value), ``renderer_name`` (the template name or simple name of the renderer), ``context`` (the context object passed to the view), and ``request`` (the request object passed to the view). Previously only ITemplateRenderers received system arguments as elements inside the main ``value`` dictionary.
Diffstat (limited to 'repoze/bfg/interfaces.py')
-rw-r--r--repoze/bfg/interfaces.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/repoze/bfg/interfaces.py b/repoze/bfg/interfaces.py
index 928ee6c54..8896c883e 100644
--- a/repoze/bfg/interfaces.py
+++ b/repoze/bfg/interfaces.py
@@ -75,10 +75,17 @@ class ITraverserFactory(Interface):
""" Return an object that implements ITraverser """
class IRenderer(Interface):
- def __call__(value):
+ def __call__(value, system):
""" Call a the renderer implementation with the result of the
view (``value``) passed in and return a result (a string or
- unicode object useful as a response body)"""
+ unicode object useful as a response body). Values computed by
+ the system are passed by the system in the ``system``
+ parameter, which is a dictionary. Keys in the dictionary
+ include: ``view`` (the view object that returned the value),
+ ``renderer_name`` (the template name or simple name of the
+ renderer), ``context`` (the context object passed to the
+ view), and ``request`` (the request object passed to the
+ view)."""
class IRendererFactory(Interface):
def __call__(name):