<?xml version="1.0" encoding="iso-8859-1"?>
<module name="Ft.Server.Server.Http.BaseRequestHandler" file="/work/a/ports/textproc/py-4suite/work/4Suite-1.0b1/build/lib.freebsd-7.1-RELEASE-i386-2.4/Ft/Server/Server/Http/BaseRequestHandler.py">
  <modification-date>2005-04-06 06:19:15</modification-date>
  <abstract>Basic functionality common to all HTTP requests and responses</abstract>
  <description>Copyright 2005 Fourthought, Inc. (USA).
Detailed license and copyright information: http://4suite.org/COPYRIGHT
Project home, documentation, distributions: http://4suite.org/</description>
  <version>1.0b1</version>
  <classes>
    <class name="BaseRequestHandler" public="yes">
      <bases>
        <base documented="yes" class="RequestHandler" module="Ft.Server.Server.RequestHandler"/>
      </bases>
      <abstract>This is the base class for all HTTP requests. It encapsulates the
request read stream, the response write stream, the data from the request,
and the data for the response. It also provides the functions to parse the
and store the components of the request, determine the real path (in the
repo) for the requested path, start handling the request including
catching any exceptions, write out a response, and log the request and
response.</abstract>
      <description>Requires in its constructor a HttpConnection instance and
a ServerConfig instance.

Instance variables:
- connection: a HttpConnection instance
- server: the ServerConfig instance passed in the constructor -- used for
   logging, document root, authentication, etc.
- rfile: request read stream
- wfile: response write stream
- request: the original Request-Line from the request
    [RFC 2616 sect. 5.1]
- method: the Method for this request (like 'GET', 'POST', etc.)
    [RFC 2616 sect. 5.1.1]
- unparsed_uri: the original Request-URI (typically URL-encoded)
    [RFC 2616 sect. 5.1.2]
- unparsed_path: the path portion of the Request-URI
    (assumes URI consists of an abs_path [RFC 2616 sect. 5.1.2]
    and, because urllib is buggy, that the path stops at the first
    ';' or '?')
- unparsed_params: because urllib is buggy, the part of path
    component of the Request-URI after the first ';'. This is a param
    [RFC 2396 sect. 3.3]
- unparsed_args: the query component of the Request-URI
    [RFC 2396 sect. 3.4]
- protocol: the protocol string as sent by the client, or 'HTTP/0.9'
- version: a float representing the version portion of the protocol
- headers_in: dictionary-like object of request headers
- path: the URL-decoded form of the unparsed_uri_path
- filename: the real path to the requested resource in the repo
- args: dictionary of unparsed_uri_args as returned by cgi.parse_qs()
- auth_type: authorization type from Authorization header of request
- user: username decoded from Authorization header of request
- password: password decoded from Authorization header of request
- body: request body as a string (bytes)
- headers_out: dictionary-like object of response headers</description>
      <method-resolution-order>
        <base name="BaseRequestHandler" module="Ft.Server.Server.Http.BaseRequestHandler"/>
        <base name="RequestHandler" module="Ft.Server.Server.RequestHandler"/>
      </method-resolution-order>
      <methods documented="yes" class="BaseRequestHandler" module="Ft.Server.Server.Http.BaseRequestHandler" inherited="no">
        <method public="no" name="__init__" id="BaseRequestHandler-__init__">
          <abstract/>
          <description/>
          <arguments>
            <arg name="self"/>
            <arg name="connection"/>
          </arguments>
          <overrides name="RequestHandler" module="Ft.Server.Server.RequestHandler"/>
        </method>
        <method public="no" name="authChecker" id="BaseRequestHandler-authChecker">
          <abstract/>
          <description/>
          <arguments>
            <arg name="self"/>
            <arg default="False" name="mandatory"/>
          </arguments>
        </method>
        <method public="no" name="do_OPTIONS" id="BaseRequestHandler-do_OPTIONS">
          <abstract>list the capabilities of this handler</abstract>
          <description/>
          <arguments>
            <arg name="self"/>
          </arguments>
        </method>
        <method public="no" name="generateRepoPath" id="BaseRequestHandler-generateRepoPath">
          <abstract>Attempts to convert the request URI to a repo path string
and ftss URI, and stores those values.</abstract>
          <description>Raises a ValueError exception if the conversion failed.</description>
          <arguments>
            <arg name="self"/>
          </arguments>
        </method>
        <method public="no" name="getMimeHeaders" id="BaseRequestHandler-getMimeHeaders">
          <abstract/>
          <description/>
          <arguments>
            <arg name="self"/>
          </arguments>
        </method>
        <method public="no" name="getRemoteHostname" id="BaseRequestHandler-getRemoteHostname">
          <abstract>Return the client address, formatted for logging.</abstract>
          <description>First the hostname returned by gethostbyaddr() is checked, then
possibly existing aliases. In case no FQDN is available, hostname
is returned.</description>
          <arguments>
            <arg name="self"/>
          </arguments>
        </method>
        <method public="no" name="getRepository" id="BaseRequestHandler-getRepository">
          <abstract/>
          <description/>
          <arguments>
            <arg name="self"/>
            <arg default="True" name="sendError"/>
          </arguments>
        </method>
        <method public="no" name="getRequestArgs" id="BaseRequestHandler-getRequestArgs">
          <abstract/>
          <description/>
          <arguments>
            <arg name="self"/>
          </arguments>
        </method>
        <method public="no" name="getRequestBody" id="BaseRequestHandler-getRequestBody">
          <abstract/>
          <description/>
          <arguments>
            <arg name="self"/>
          </arguments>
        </method>
        <method public="no" name="handle" id="BaseRequestHandler-handle">
          <abstract/>
          <description/>
          <arguments>
            <arg name="self"/>
          </arguments>
          <overrides name="RequestHandler" module="Ft.Server.Server.RequestHandler"/>
        </method>
        <method public="no" name="joinQueryArgs" id="BaseRequestHandler-joinQueryArgs">
          <abstract>Join two query argument dicts.</abstract>
          <description>Given two query string argument dictionaries from cgi.parse_qs(),
return a new dictionary of the combined arguments, appending the
values from args2 to the values for args1 for each duplicate key.</description>
          <arguments>
            <arg name="self"/>
            <arg name="args1"/>
            <arg name="args2"/>
          </arguments>
        </method>
        <method public="no" name="localDateTimeString" id="BaseRequestHandler-localDateTimeString">
          <abstract>Return the request time formatted for logging.</abstract>
          <description/>
          <arguments>
            <arg name="self"/>
          </arguments>
        </method>
        <method public="no" name="logTransaction" id="BaseRequestHandler-logTransaction">
          <abstract/>
          <description/>
          <arguments>
            <arg name="self"/>
          </arguments>
        </method>
        <method public="no" name="parseUri" id="BaseRequestHandler-parseUri">
          <abstract>Parse the Request-URI, storing its components (path, query,
etc.) in the instance (self.unparsed_path, self.path, etc.)</abstract>
          <description/>
          <arguments>
            <arg name="self"/>
            <arg name="uri"/>
          </arguments>
        </method>
        <method public="no" name="processRequest" id="BaseRequestHandler-processRequest">
          <abstract>Handle a single HTTP request.</abstract>
          <description/>
          <arguments>
            <arg name="self"/>
          </arguments>
        </method>
        <method public="no" name="processResponse" id="BaseRequestHandler-processResponse">
          <abstract/>
          <description/>
          <arguments>
            <arg name="self"/>
          </arguments>
        </method>
        <method public="no" name="readRequest" id="BaseRequestHandler-readRequest">
          <abstract/>
          <description/>
          <arguments>
            <arg name="self"/>
          </arguments>
        </method>
        <method public="no" name="readRequestLine" id="BaseRequestHandler-readRequestLine">
          <abstract>Parse the Request-Line of an HTTP request coming in via the
rfile stream. The Request-Line is the first line of the request.
(It should look like &quot;GET /foo HTTP/1.1&quot;).</abstract>
          <description>If the request line is in some way malformed, an error repsonse
is written directly to the wfile stream and false is returned,
otherwise true indicates success.

Progress and errors are logged to server.errorLog.</description>
          <arguments>
            <arg name="self"/>
          </arguments>
        </method>
        <method public="no" name="rfcDateTimeString" id="BaseRequestHandler-rfcDateTimeString">
          <abstract>Return the request time formatted for a message header.</abstract>
          <description/>
          <arguments>
            <arg name="self"/>
          </arguments>
        </method>
        <method public="no" name="send_error" id="BaseRequestHandler-send_error">
          <abstract>Send and log an error reply.</abstract>
          <description>Arguments are the error code, and a detailed message.
The detailed message defaults to the short entry matching the
response code.

This sends an error response (so it must be called before any
output has been generated), logs the error, and finally sends
a piece of HTML explaining the error to the user.</description>
          <arguments>
            <arg name="self"/>
            <arg name="code"/>
            <var-keywords name="keywords"/>
          </arguments>
        </method>
        <method public="no" name="unhandledException" id="BaseRequestHandler-unhandledException">
          <abstract/>
          <description/>
          <arguments>
            <arg name="self"/>
            <arg name="function"/>
          </arguments>
        </method>
      </methods>
      <fields documented="yes" class="BaseRequestHandler" module="Ft.Server.Server.Http.BaseRequestHandler" inherited="no">
        <field public="no" name="monthname" id="BaseRequestHandler-monthname">
          <value>['', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']</value>
        </field>
        <field public="no" name="sys_version" id="BaseRequestHandler-sys_version">
          <value>'Python/2.4.5'</value>
        </field>
        <field public="no" name="weekdayname" id="BaseRequestHandler-weekdayname">
          <value>['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']</value>
        </field>
      </fields>
    </class>
  </classes>
  <fields>
    <field public="no" name="ANONYMOUS_USER_NAME" id="ANONYMOUS_USER_NAME">
      <value>'guest'</value>
    </field>
    <field public="no" name="CHARSET_PAT" id="CHARSET_PAT">
      <abstract>Compiled regular expression objects</abstract>
      <description/>
      <value>&lt;_sre.SRE_Pattern object&gt;</value>
    </field>
    <field public="no" name="FTSS_URI_SCHEME" id="FTSS_URI_SCHEME">
      <value>'ftss'</value>
    </field>
    <field public="no" name="PATH_END_PAT" id="PATH_END_PAT">
      <abstract>Compiled regular expression objects</abstract>
      <description/>
      <value>&lt;_sre.SRE_Pattern object&gt;</value>
    </field>
    <field public="no" name="SERVER_VERSION" id="SERVER_VERSION">
      <value>'FtServer/1.0b1'</value>
    </field>
    <field public="no" name="StringTypes" id="StringTypes">
      <value>(&lt;type 'str'&gt;, &lt;type 'unicode'&gt;)</value>
    </field>
    <field public="no" name="TRAILING_PARAMS_PAT" id="TRAILING_PARAMS_PAT">
      <abstract>Compiled regular expression objects</abstract>
      <description/>
      <value>&lt;_sre.SRE_Pattern object&gt;</value>
    </field>
    <field public="no" name="__all__" id="__all__">
      <value>['BaseRequestHandler']</value>
    </field>
    <field public="no" name="__version__" id="__version__">
      <value>'1.0b1'</value>
    </field>
  </fields>
</module>
