From 4df5751de28947538da491dc8ebe0dfb27f742d5 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 19 Jul 2008 01:17:21 +0000 Subject: - 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``. --- repoze/bfg/interfaces.py | 35 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 23 deletions(-) (limited to 'repoze/bfg/interfaces.py') 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 -- cgit v1.2.3