summaryrefslogtreecommitdiff
path: root/repoze/bfg/interfaces.py
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2008-07-19 01:17:21 +0000
committerChris McDonough <chrism@agendaless.com>2008-07-19 01:17:21 +0000
commit4df5751de28947538da491dc8ebe0dfb27f742d5 (patch)
tree491c7029cb50f4baed54ddf7485b4aa0bb02d739 /repoze/bfg/interfaces.py
parent7bce0d6d925370dd5721100c28693f806b68344b (diff)
downloadpyramid-4df5751de28947538da491dc8ebe0dfb27f742d5.tar.gz
pyramid-4df5751de28947538da491dc8ebe0dfb27f742d5.tar.bz2
pyramid-4df5751de28947538da491dc8ebe0dfb27f742d5.zip
- The concept of "view factories" was removed in favor of always
calling a view, which is a callable that returns a response directly (as opposed to returning a view). As a result, the ``factory`` attribute in the bfg:view ZCML statement has been renamed to ``view``. Various interface names were changed also. - ``render_template`` and ``render_transform`` no longer return a Response object. Instead, these return strings. The old behavior can be obtained by using ``render_template_to_response`` and ``render_transform_to_response``.
Diffstat (limited to 'repoze/bfg/interfaces.py')
-rw-r--r--repoze/bfg/interfaces.py35
1 files changed, 12 insertions, 23 deletions
diff --git a/repoze/bfg/interfaces.py b/repoze/bfg/interfaces.py
index 4bb385438..710b91074 100644
--- a/repoze/bfg/interfaces.py
+++ b/repoze/bfg/interfaces.py
@@ -10,44 +10,33 @@ class IResponse(Interface):
app_iter = Attribute('Iterable representing the response body')
class IView(Interface):
- def __call__(*arg, **kw):
- """ Must return an object that implements IResponse; args are
- mapped into an IView's __call__ by mapply-like code """
-
-class INodeView(IView):
- def __call__(node, **kw):
- """ Must return an object that implements IResponse; node is an
- lxml.etree Element and **kw provides parameters to an XSLT
- processor """
-
-class IViewFactory(Interface):
def __call__(context, request):
- """ Return an object that implements IView """
+ """ Must return an object that implements IResponse """
class IRootPolicy(Interface):
def __call__(environ):
""" Return a root object """
-class IPublishTraverser(Interface):
+class ITraverser(Interface):
def __call__(path):
""" Return a tuple in the form (context, name, subpath), typically
the result of an object graph traversal """
-class IPublishTraverserFactory(Interface):
+class ITraverserFactory(Interface):
def __call__(context, request):
""" Return an object that implements IPublishTraverser """
-class IWSGIApplication(Interface):
- def __call__(environ, start_response):
- """ A PEP 333 application """
+class ITemplateFactory(Interface):
+ def __call__(path):
+ """ Return an an ITemplate given a filesystem path """
-class IWSGIApplicationFactory(Interface):
- def __call__(context, request, view):
- """ Return an object that implements IWSGIApplication """
+class ITemplate(Interface):
+ def __call__(**kw):
+ """ Return a string result given a template path """
-class ITemplateFactory(Interface):
- def __call__(template_path):
- """ Return an IView given a template path """
+class INodeTemplate(Interface):
+ def __call__(node, **kw):
+ """ Return a string result given a template path """
class ISecurityPolicy(Interface):
""" A utility that provides a mechanism to check authorization