summaryrefslogtreecommitdiff
path: root/repoze/bfg/interfaces.py
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2010-09-12 12:45:07 +0000
committerChris McDonough <chrism@agendaless.com>2010-09-12 12:45:07 +0000
commit8f45bee662176e1b2a850a4a9fe25d26b03093a6 (patch)
tree852a99ba184e1c1b24fb09197df2801372200541 /repoze/bfg/interfaces.py
parent887a0c78919e6c3d1acfe1f9cc16a3aaf054a514 (diff)
downloadpyramid-8f45bee662176e1b2a850a4a9fe25d26b03093a6.tar.gz
pyramid-8f45bee662176e1b2a850a4a9fe25d26b03093a6.tar.bz2
pyramid-8f45bee662176e1b2a850a4a9fe25d26b03093a6.zip
- 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.
Diffstat (limited to 'repoze/bfg/interfaces.py')
-rw-r--r--repoze/bfg/interfaces.py46
1 files changed, 39 insertions, 7 deletions
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')