From 4936f862588240c51e619a65aa5d574ba29d784b Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 31 May 2009 03:13:13 +0000 Subject: Features -------- - It is now possible to register a custom ``repoze.bfg.interfaces.INotFoundView`` for a given application. This feature replaces the ``repoze.bfg.interfaces.INotFoundAppFactory`` feature previously described in the Hooks chapter. The INotFoundView will be called when the framework detects that a view lookup done as a result of a reqest fails; it should accept a context object and a request object; it should return an IResponse object (a webob response, basically). See the Hooks narrative chapter of the BFG docs for more info. Deprecations ------------ - The ``repoze.bfg.interfaces.IUnauthorizedAppFactory`` interface has been deprecated in favor of using the new ``repoze.bfg.interfaces.IForbiddenResponseFactory`` mechanism. --- repoze/bfg/interfaces.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'repoze/bfg/interfaces.py') diff --git a/repoze/bfg/interfaces.py b/repoze/bfg/interfaces.py index 8316c58bc..79ef25f09 100644 --- a/repoze/bfg/interfaces.py +++ b/repoze/bfg/interfaces.py @@ -184,18 +184,21 @@ class IForbiddenView(Interface): repoze.bfg router during traversal or url dispatch. The ``request`` will be the request object which caused the deny.""" -class INotFoundAppFactory(Interface): - """ A utility which returns a NotFound WSGI application factory """ - def __call__(): - """ Return a callable which returns a notfound WSGI - application. When the WSGI application is invoked, +class INotFoundView(Interface): + """ A utility which returns a NotFound response (an IResponse) + when a view cannot be located for a particular URL""" + def __call__(context, request): + """ Return a NotFound response. When the view is rendered, a``message`` key in the WSGI environ provides information - pertaining to the reason for the notfound.""" + pertaining to the reason for the notfound error.""" + +class INotFoundAppFactory(Interface): + """ A utility which returns a NotFound WSGI application factory. + Deprecated in repoze.bfg 0.9 in favor of INotFoundView""" class IUnauthorizedAppFactory(Interface): """ A utility which returns an Unauthorized WSGI application - factory (deprecated in repoze.bfg 0.8.2) in favor of - IForbiddenResponseFactory """ + factory. Deprecated in repoze.bfg 0.9 in favor of IForbiddenView""" class IContextURL(Interface): """ An adapter which deals with URLs related to a context. -- cgit v1.2.3