Package WebStack :: Package Resources :: Module ResourceMap :: Class MapResource
[show private | hide private]
[frames | no frames]

Class MapResource


A resource mapping names to other resources.
Method Summary
  __init__(self, mapping, directory_redirects)
Initialise the resource with a 'mapping' of names to resources.
  respond(self, trans)
Using the path information from the given transaction 'trans', invoke mapped resources.
  send_error(self, trans)
Send the error using the given 'trans'.
  send_redirect(self, trans)
Send a redirect using the given 'trans', adding a "/" character to the end of the request path.

Method Details

__init__(self, mapping, directory_redirects=1)
(Constructor)

Initialise the resource with a 'mapping' of names to resources. The 'mapping' should be a dictionary-like object employing simple names without "/" characters; the special value None is used where no name corresponds to that used in the request path and may be used to map to a "catch all" resource.

The optional 'directory_redirects' parameter, if set to a true value (as is the default setting), causes a redirect adding a trailing "/" character if the request path does not end with such a character.

respond(self, trans)

Using the path information from the given transaction 'trans', invoke mapped resources. Otherwise return an error condition.

send_error(self, trans)

Send the error using the given 'trans'.

send_redirect(self, trans)

Send a redirect using the given 'trans', adding a "/" character to the end of the request path.

Generated by Epydoc 2.1 on Fri Jul 22 23:16:51 2005 http://epydoc.sf.net