From 8f45bee662176e1b2a850a4a9fe25d26b03093a6 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 12 Sep 2010 12:45:07 +0000 Subject: - The BFG router now emits an additional event unconditionally at the end of request processing: ``repoze.bfg.interfaces.IFinishedRequest``. This event is meant to be used when it is necessary to perform unconditional cleanup after request processing. See the ``repoze.bfg.events.FinishedRequest`` class documentation for more information. - The ``repoze.bfg.interfaces.IWSGIApplicationCreatedEvent`` event interface was renamed to ``repoze.bfg.interfaces.IApplicationCreated``. Likewise, the ``repoze.bfg.events.WSGIApplicationCreatedEvent`` class was renamed to ``repoze.bfg.events.ApplicationCreated``. The older aliases will continue to work indefinitely. - The ``repoze.bfg.interfaces.IAfterTraversal`` event interface was renamed to ``repoze.bfg.interfaces.IContextFound``. Likewise, the ``repoze.bfg.events.AfterTraveral`` class was renamed to ``repoze.bfg.events.ContextFound``. The older aliases will continue to work indefinitely. --- repoze/bfg/interfaces.py | 46 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 7 deletions(-) (limited to 'repoze/bfg/interfaces.py') diff --git a/repoze/bfg/interfaces.py b/repoze/bfg/interfaces.py index 44fe84c18..8730a5294 100644 --- a/repoze/bfg/interfaces.py +++ b/repoze/bfg/interfaces.py @@ -3,28 +3,60 @@ from zope.interface import Interface # public API interfaces -class IAfterTraversal(Interface): - """ An event type that is emitted after :mod:`repoze.bfg` - completes traversal but before it calls any view code.""" +class IContextFound(Interface): + """ An event type that is emitted after :mod:`repoze.bfg` finds a + :term:`context` object but before it calls any view code. See the + documentation attached to :class:`repoze.bfg.events.ContextFound` + for more information. + + .. note:: For backwards compatibility with versions of + :mod:`repoze.bfg` before 1.3, this event interface can also be + imported as :class:`repoze.bfg.interfaces.IAfterTraversal`. + """ request = Attribute('The request object') +IAfterTraversal = IContextFound + class INewRequest(Interface): """ An event type that is emitted whenever :mod:`repoze.bfg` - begins to process a new request""" + begins to process a new request. See the documentation attached + to :class:`repoze.bfg.events.NewRequest` for more information.""" request = Attribute('The request object') class INewResponse(Interface): """ An event type that is emitted whenever any :mod:`repoze.bfg` - view returns a response.""" + view returns a response. See the + documentation attached to :class:`repoze.bfg.events.NewResponse` + for more information.""" request = Attribute('The request object') response = Attribute('The response object') -class IWSGIApplicationCreatedEvent(Interface): +class IApplicationCreated(Interface): """ Event issued when the :meth:`repoze.bfg.configuration.Configurator.make_wsgi_app` method - is called.""" + is called. See the documentation attached to + :class:`repoze.bfg.events.ApplicationCreated` for more + information. + + .. note:: For backwards compatibility with :mod:`repoze.bfg` + versions before 1.3, this interface can also be imported as + :class:`repoze.bfg.interfaces.IWSGIApplicationCreatedEvent. + """ app = Attribute(u"Published application") +class IFinishedRequest(Interface): + """ + This :term:`event` is sent after all request processing is + finished. See the + documentation attached to :class:`repoze.bfg.events.FinishedRequest` + for more information. + + .. note:: This event type is new as of :mod:`repoze.bfg` 1.3. + """ + request = Attribute('The request object') + +IWSGIApplicationCreatedEvent = IApplicationCreated # b /c + class IResponse(Interface): # not an API status = Attribute('WSGI status code of response') headerlist = Attribute('List of response headers') -- cgit v1.2.3