Module spug.web.cgi

Universal CGI classes and functions.

Classes

Functions

parseQuery(queryString)

def parseQuery(queryString):

Parses a CGI query string and returns a dictionary containing its values.

encodeString(str)

def encodeString(str):

Encodes a text string, converting all of the unsavory characters to the officially sanctioned '%' escape sequences.

_encodeMatch(m)

def _encodeMatch(m):

_fixEscape(escape)

def _fixEscape(escape):

getRequest(env, args, src)

def getRequest(env, args, src = None):

Returns a CGIRequest from the dictionary env. env should contain the standard CGI environment variables.

if src is provided, it should be a file object (usually the CGI program's standard input stream) from which to parse query parameters that have come in through a form's "POST" method.

args should be the CGI command's argument list.

The following variables are currently used if they exist:

PATH_INFO

Additional path info added after the cgi program name.

QUERY_STRING

A string containing the standard CGI representation of query parameters.