Package twisted :: Package web :: Module resource :: Class IResource
[show private | hide private]
[frames | no frames]

Class IResource

Interface --+
            |
           IResource


A web resource.
Method Summary
  getChild(name, request)
(informal) Resource subclasses can override this to produce dynamic children--names that are not present in the children dictionary populated by putChild.
  getChildWithDefault(name, request)
Return a child with the given name for the given request.
  listNames()
Return a list of string names that are valid children of this resource.
  putChild(path, child)
Put a child IResource implementor at the given path.
  render(request)
Render a request.

Class Variable Summary
int isLeaf

Method Details

getChild(name, request)

(informal) Resource subclasses can override this to produce dynamic children--names that are not present in the children dictionary populated by putChild.

getChildWithDefault(name, request)

Return a child with the given name for the given request. This is the external interface used by the Resource publishing machinery. If implementing IResource without subclassing Resource, it must be provided. However, if subclassing Resource, getChild overridden instead.

listNames()

Return a list of string names that are valid children of this resource.

putChild(path, child)

Put a child IResource implementor at the given path.

render(request)

Render a request. This is called on the leaf resource for a request. Render must return either a string, which will be sent to the browser as the HTML for the request, or server.NOT_DONE_YET. If NOT_DONE_YET is returned, at some point later (in a Deferred callback, usually) call request.write("<html>") to write data to the request, and request.finish() to send the data to the browser.

Class Variable Details

isLeaf

Type:
int
Value:
0                                                                      

Generated by Epydoc 1.1 on Thu Apr 17 12:52:32 2003 http://epydoc.sf.net