added skinning support to manual response mechanism

This commit is contained in:
Darren Ranalli 2009-10-19 21:15:56 +00:00
parent ccee3d2db9
commit 678dc259b8

View File

@ -62,6 +62,14 @@ class WebRequest(object):
# --------------------------------------------------------------------------------
class SkinningReplyTo:
def __init__(self, replyTo, dispatcher, uri):
self._replyTo = replyTo
self._dispatcher = dispatcher
self._uri = uri
def respond(self, response):
self._replyTo.respond(self._dispatcher.landingPage.skin(response, self._uri))
class WebRequestDispatcher(object):
"""
@ -144,7 +152,11 @@ class WebRequestDispatcher(object):
else:
req.respond(result)
else:
args["replyTo"] = req
if autoSkin:
rt = SkinningReplyTo(req, self, uri)
else:
rt = req
args["replyTo"] = rt
apply(callable,(),args)