From bfc0689b768591aad9ce323f583b94d6df6e2ebd Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Wed, 22 Dec 2010 15:26:01 -0500 Subject: Adding a `controller` reference to the state object that gets passed to hooks. This will allow implementations of PecanHook to have access to the controller that was routed to for the current request. --- pecan/pecan.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pecan/pecan.py b/pecan/pecan.py index 1ae605c..a45e989 100644 --- a/pecan/pecan.py +++ b/pecan/pecan.py @@ -156,6 +156,9 @@ class Pecan(MonitorableProcess): im_self = controller.im_self handlers = controller.pecan['generic_handlers'] controller = handlers.get(request.method, handlers['DEFAULT']) + + # add the controller to the state so that hooks can use it + state.controller = controller # determine content type if content_type is None: -- cgit v1.2.1