t.w.r.WrapperResource(object) : class documentation

Part of twisted.web2.resource View Source View In Hierarchy

Known subclasses: twisted.web2.log.LogWrapperResource

Implements interfaces: twisted.web2.iweb.IResource

An iweb.IResource implementation which wraps a RenderMixin instance and provides a hook in which a subclass can implement logic that is called before request processing on the contained Resource.
Method __init__ Undocumented
Method hook No summary
Method locateChild Locate another object which can be adapted to IResource.
Method renderHTTP Return an IResponse or a deferred which will fire an IResponse. This response will be written to the web browser which initiated the request.
def __init__(self, resource): (source)
Undocumented
def hook(self, request): (source)
Override this method in order to do something before passing control on to the wrapped resource's renderHTTP and locateChild methods.
ReturnsNone or a Deferred. If a deferred object is returned, it's value is ignored, but renderHTTP and locateChild are chained onto the deferred as callbacks.
def locateChild(self, request, segments): (source)
Locate another object which can be adapted to IResource.
Returns

A 2-tuple of (resource, remaining-path-segments), or a deferred which will fire the above.

Causes the object publishing machinery to continue on with specified resource and segments, calling the appropriate method on the specified resource.

If you return (self, server.StopTraversal), this instructs web2 to immediately stop the lookup stage, and switch to the rendering stage, leaving the remaining path alone for your render function to handle.
def renderHTTP(self, request): (source)
Return an IResponse or a deferred which will fire an IResponse. This response will be written to the web browser which initiated the request.
API Documentation for Twisted, generated by pydoctor at 2011-10-27 15:57:47.