From ff1213e8f2aed987108ba57aed517c033491b1aa Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 14 Apr 2010 02:49:19 +0000 Subject: Add "exception views" work contributed primarily by Andrey Popp by merging the "phash" branch. --- repoze/bfg/interfaces.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'repoze/bfg/interfaces.py') diff --git a/repoze/bfg/interfaces.py b/repoze/bfg/interfaces.py index c322de2ff..53a905972 100644 --- a/repoze/bfg/interfaces.py +++ b/repoze/bfg/interfaces.py @@ -29,6 +29,9 @@ class IWSGIApplicationCreatedEvent(Interface): class IRequest(Interface): """ Request type interface attached to all request objects """ +# for exception view lookups +IRequest.combined = IRequest + class IRouteRequest(Interface): """ *internal only* interface used as in a utility lookup to find route-specific interfaces. Not an API.""" @@ -78,6 +81,12 @@ class IResponseFactory(Interface): should accept all the arguments that the webob.Response class accepts)""" +class IViewClassifier(Interface): + """ *Internal only* marker interface for views.""" + +class IExceptionViewClassifier(Interface): + """ *Internal only* marker interface for exception views.""" + class IView(Interface): def __call__(context, request): """ Must return an object that implements IResponse. May @@ -99,7 +108,7 @@ class IMultiView(ISecuredView): """ *internal only*. A multiview is a secured view that is a collection of other views. Each of the views is associated with zero or more predicates. Not an API.""" - def add(view, predicates, score): + def add(view, predicates, order, accept=None, phash=None): """ Add a view to the multiview. """ class IRootFactory(Interface): @@ -242,4 +251,4 @@ class IPackageOverrides(Interface): # VH_ROOT_KEY is an interface; its imported from other packages (e.g. # traversalwrapper) -VH_ROOT_KEY = 'HTTP_X_VHM_ROOT' +VH_ROOT_KEY = 'HTTP_X_VHM_ROOT' -- cgit v1.2.3