Package aquarium :: Package wsadaptor :: Module FastCGIAdaptor :: Class FastCGIAdaptor
[show private | hide private]
[frames | no frames]

Class FastCGIAdaptor

WebServerAdaptor --+
                   |
                  FastCGIAdaptor


This subclass of WebServerAdaptor is for FastCGI.

To use this, you'll need to download thfcgi.py and install it into Python's site-packages directory or somewhere else in your PYTHONPATH. I can't distribute it with Aquarium because it's GPL and Aquarium's not (this is a statement of fact, not a complaint).

Here is a minimal FastCGI entry point. Naturally, you'll almost assuredly want to add code to update sys.path and packagePath before importing anything from Aquarium:

#!/usr/bin/python

from thfcgi import THFCGI

from aquarium.wsadaptor.FastCGIAdaptor import handler


THFCGI(handler).run()

The following urlscheme modules can be used with this Web server adaptor: QueryParameters, PathInfo.

The following private variables are used:

_req, _cgiEnv, _form
The request, CGI environment dict, and form given to use by thfcgi.

Method Summary
  __init__(self, req, cgiEnv, form)
Accept all the arguments.
  getCgiEnv(self)
Return CGI-like environmental variables.
  getForm(self)
Instantiate some cgi.FieldStorage and return the instance.
  setResponseCode(self, code, _FastCGIAdaptor__ignored_msg)
Set the Web server response code and message.
  write(self, s)
Output a string.
    Inherited from WebServerAdaptor
  writeHeaders(self, headersList)
Output a list of header strings.

Method Details

__init__(self, req, cgiEnv, form)
(Constructor)

Accept all the arguments.

getCgiEnv(self)

Return CGI-like environmental variables.

Overrides:
aquarium.wsadaptor.WebServerAdaptor.WebServerAdaptor.getCgiEnv

getForm(self)

Instantiate some cgi.FieldStorage and return the instance.

Overrides:
aquarium.wsadaptor.WebServerAdaptor.WebServerAdaptor.getForm

setResponseCode(self, code=200, _FastCGIAdaptor__ignored_msg='Script output follows')

Set the Web server response code and message.

Keword arguments:

code
The default means "OK".
__ignored_msg
mod_fastcgi does not have a place for this.

mod_fastcgi sets the response code by using a fake "Status" header.

Overrides:
aquarium.wsadaptor.WebServerAdaptor.WebServerAdaptor.setResponseCode

write(self, s)

Output a string.

Overrides:
aquarium.wsadaptor.WebServerAdaptor.WebServerAdaptor.write

Generated by Epydoc 2.1 on Mon Jan 1 16:34:19 2007 http://epydoc.sf.net