CGIHTTPServer (version 0.4)
index
/usr/lib/python2.1/CGIHTTPServer.py

CGI-savvy HTTP Server.
 
This module builds on SimpleHTTPServer by implementing GET and POST
requests to cgi-bin scripts.
 
If the os.fork() function is not present (e.g. on Windows),
os.popen2() is used as a fallback, with slightly altered semantics; if
that function is not present either (e.g. on Macintosh), only Python
scripts are supported, and they are executed by the current process.
 
In all cases, the implementation is intentionally naive -- all
requests are executed sychronously.
 
SECURITY WARNING: DON'T USE THIS CODE UNLESS YOU ARE INSIDE A FIREWALL
-- it may execute arbitrary Python code or external programs.

 
Modules
            
BaseHTTPServer
SimpleHTTPServer
os
sys
urllib

 
Classes
            
SimpleHTTPServer.SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler)
CGIHTTPRequestHandler

 
class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler)
      Complete HTTP server with GET, HEAD and POST commands.
 
GET and HEAD also support running CGI scripts.
 
The POST command is *only* implemented for CGI scripts.
 
  
__del__(self) from SocketServer.BaseRequestHandler
__init__(self, request, client_address, server) from SocketServer.BaseRequestHandler
address_string(self) from BaseHTTPServer.BaseHTTPRequestHandler
copyfile(self, source, outputfile) from SimpleHTTPServer.SimpleHTTPRequestHandler
date_time_string(self) from BaseHTTPServer.BaseHTTPRequestHandler
do_GET(self) from SimpleHTTPServer.SimpleHTTPRequestHandler
do_HEAD(self) from SimpleHTTPServer.SimpleHTTPRequestHandler
do_POST(self)
Serve a POST request.
 
This is only implemented for CGI scripts.
end_headers(self) from BaseHTTPServer.BaseHTTPRequestHandler
finish(self) from SocketServer.StreamRequestHandler
guess_type(self, path) from SimpleHTTPServer.SimpleHTTPRequestHandler
handle(self) from BaseHTTPServer.BaseHTTPRequestHandler
is_cgi(self)
Test whether self.path corresponds to a CGI script.
 
Return a tuple (dir, rest) if self.path requires running a
CGI script, None if not.  Note that rest begins with a
slash if it is not empty.
 
The default implementation tests whether the path
begins with one of the strings in the list
self.cgi_directories (and the next character is a '/'
or the end of the string).
is_executable(self, path)
Test whether argument path is an executable file.
is_python(self, path)
Test whether argument path is a Python script.
list_directory(self, path) from SimpleHTTPServer.SimpleHTTPRequestHandler
log_date_time_string(self) from BaseHTTPServer.BaseHTTPRequestHandler
log_error(self, *args) from BaseHTTPServer.BaseHTTPRequestHandler
log_message(self, format, *args) from BaseHTTPServer.BaseHTTPRequestHandler
log_request(self, code='-', size='-') from BaseHTTPServer.BaseHTTPRequestHandler
parse_request(self) from BaseHTTPServer.BaseHTTPRequestHandler
run_cgi(self)
Execute a CGI script.
send_error(self, code, message=None) from BaseHTTPServer.BaseHTTPRequestHandler
send_head(self)
Version of send_head that support CGI scripts
send_header(self, keyword, value) from BaseHTTPServer.BaseHTTPRequestHandler
send_response(self, code, message=None) from BaseHTTPServer.BaseHTTPRequestHandler
setup(self) from SocketServer.StreamRequestHandler
translate_path(self, path) from SimpleHTTPServer.SimpleHTTPRequestHandler
version_string(self) from BaseHTTPServer.BaseHTTPRequestHandler

 
Functions
            
executable(path)
Test for executable file.
nobody_uid()
Internal routine to get nobody's uid
test(HandlerClass=<class CGIHTTPServer.CGIHTTPRequestHandler>, ServerClass=<class BaseHTTPServer.HTTPServer>)

 
Data
             __all__ = ['CGIHTTPRequestHandler']
__file__ = '/usr/lib/python2.1/CGIHTTPServer.pyc'
__name__ = 'CGIHTTPServer'
__version__ = '0.4'
nobody = None