From 3f34aa05a48e5d9ae7b43f717b5ad9061effb08c Mon Sep 17 00:00:00 2001 From: Bert JW Regeer Date: Sun, 10 Apr 2016 22:17:19 -0600 Subject: Update documentation in event.py for BeforeTraversal --- pyramid/events.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pyramid/events.py b/pyramid/events.py index e467e4012..35da2fa6f 100644 --- a/pyramid/events.py +++ b/pyramid/events.py @@ -134,12 +134,14 @@ class NewResponse(object): class BeforeTraversal(object): """ An instance of this class is emitted as an :term:`event` after the - :app:`Pyramid` :term:`router` finds a :term:`route` object but before any - traversal or view code is executed. The instance has an attribute, - ``request``, which is the request object generated by :app:`Pyramid`. + :app:`Pyramid` :term:`router` has attempted to find a :term:`route` object + but before any traversal or view code is executed. The instance has an + attribute, ``request``, which is the request object generated by + :app:`Pyramid`. - Notably, the request object will have an attributed named - ``matched_route``, which is the matched route that was found. + Notably, the request object **may** have an attribute named + ``matched_route``, which is the matched route if found. If no route + matched, this attribute is not available. This class implements the :class:`pyramid.interfaces.IBeforeTraversal` interface. @@ -175,7 +177,7 @@ class ContextFound(object): AfterTraversal = ContextFound # b/c as of 1.0 @implementer(IApplicationCreated) -class ApplicationCreated(object): +class ApplicationCreated(object): """ An instance of this class is emitted as an :term:`event` when the :meth:`pyramid.config.Configurator.make_wsgi_app` is called. The instance has an attribute, ``app``, which is an @@ -262,4 +264,3 @@ class BeforeRender(dict): dict.__init__(self, system) self.rendering_val = rendering_val - -- cgit v1.2.3