[Python-checkins] python/dist/src/Doc/lib libsimplehttp.tex, 1.4,
1.5
akuchling at users.sourceforge.net
akuchling at users.sourceforge.net
Sat Aug 7 21:10:39 CEST 2004
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8104
Modified Files:
libsimplehttp.tex
Log Message:
Various minor edits
Index: libsimplehttp.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libsimplehttp.tex,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** libsimplehttp.tex 7 Aug 2004 19:06:48 -0000 1.4
--- libsimplehttp.tex 7 Aug 2004 19:10:36 -0000 1.5
***************
*** 9,25 ****
The \module{SimpleHTTPServer} module defines a request-handler class,
! interface compatible with \class{BaseHTTPServer.BaseHTTPRequestHandler}
! which serves files only from a base directory.
The \module{SimpleHTTPServer} module defines the following class:
\begin{classdesc}{SimpleHTTPRequestHandler}{request, client_address, server}
! This class is used, to serve files from current directory and below,
directly mapping the directory structure to HTTP requests.
! A lot of the work is done by the base class
! \class{BaseHTTPServer.BaseHTTPRequestHandler}, such as parsing the
! request. This class implements the \function{do_GET()} and
! \function{do_HEAD()} functions.
\end{classdesc}
--- 9,24 ----
The \module{SimpleHTTPServer} module defines a request-handler class,
! interface-compatible with \class{BaseHTTPServer.BaseHTTPRequestHandler},
! that serves files only from a base directory.
The \module{SimpleHTTPServer} module defines the following class:
\begin{classdesc}{SimpleHTTPRequestHandler}{request, client_address, server}
! This class is used to serve files from the current directory and below,
directly mapping the directory structure to HTTP requests.
! A lot of the work, such as parsing the request, is done by the base
! class \class{BaseHTTPServer.BaseHTTPRequestHandler}. This class
! implements the \function{do_GET()} and \function{do_HEAD()} functions.
\end{classdesc}
***************
*** 33,37 ****
\begin{memberdesc}{extensions_map}
! A dictionary mapping suffixes into MIME types. Default is signified
by an empty string, and is considered to be \code{application/octet-stream}.
The mapping is used case-insensitively, and so should contain only
--- 32,36 ----
\begin{memberdesc}{extensions_map}
! A dictionary mapping suffixes into MIME types. The default is signified
by an empty string, and is considered to be \code{application/octet-stream}.
The mapping is used case-insensitively, and so should contain only
***************
*** 44,48 ****
This method serves the \code{'HEAD'} request type: it sends the
headers it would send for the equivalent \code{GET} request. See the
! \method{do_GET()} method for more complete explanation of the possible
headers.
\end{methoddesc}
--- 43,47 ----
This method serves the \code{'HEAD'} request type: it sends the
headers it would send for the equivalent \code{GET} request. See the
! \method{do_GET()} method for a more complete explanation of the possible
headers.
\end{methoddesc}
***************
*** 62,72 ****
returned. Any \exception{IOError} exception in opening the requested
file is mapped to a \code{404}, \code{'File not found'}
! error. Otherwise, the content type is guessed using the
\var{extensions_map} variable.
! A \code{'Content-type:'} with the guessed content type is output, and
! then a blank line, signifying end of headers, and then the contents of
! the file. If the file's MIME type starts with \code{text/} the file is
! opened in text mode; otherwise binary mode is used.
For example usage, see the implementation of the \function{test()}
--- 61,73 ----
returned. Any \exception{IOError} exception in opening the requested
file is mapped to a \code{404}, \code{'File not found'}
! error. Otherwise, the content type is guessed by calling the
! \method{guess_type()} method, which in turn uses the
\var{extensions_map} variable.
! A \code{'Content-type:'} header with the guessed content type is
! output, followed by a blank line signifying the end of the headers,
! and then the contents of the file are output. If the file's MIME type
! starts with \code{text/} the file is opened in text mode; otherwise
! binary mode is used.
For example usage, see the implementation of the \function{test()}
More information about the Python-checkins
mailing list