[Python-checkins] CVS: python/dist/src/Doc/lib libmailbox.tex,1.20,1.21 libmimetools.tex,1.19,1.20 libmimetypes.tex,1.6,1.7 librfc822.tex,1.36,1.37 liburllib.tex,1.37,1.38

Fred L. Drake fdrake@users.sourceforge.net
Fri, 03 Aug 2001 11:39:38 -0700


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory usw-pr-cvs1:/tmp/cvs-serv10635/lib

Modified Files:
	libmailbox.tex libmimetools.tex libmimetypes.tex librfc822.tex 
	liburllib.tex 
Log Message:

Apply the new \mailheader macro where appropriate, and fix a few small
markup inconsistencies.


Index: libmailbox.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libmailbox.tex,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** libmailbox.tex	2001/05/21 21:23:01	1.20
--- libmailbox.tex	2001/08/03 18:39:36	1.21
***************
*** 95,100 ****
              Netscape Mail on \UNIX: Why the Content-Length Format is
              Bad}{A description of problems with relying on the
!             Content-Length header for messages stored in mailbox
!             files.}
  \end{seealso}
  
--- 95,100 ----
              Netscape Mail on \UNIX: Why the Content-Length Format is
              Bad}{A description of problems with relying on the
!             \mailheader{Content-Length} header for messages stored in
!             mailbox files.}
  \end{seealso}
  

Index: libmimetools.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libmimetools.tex,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** libmimetools.tex	2000/10/10 22:00:03	1.19
--- libmimetools.tex	2001/08/03 18:39:36	1.20
***************
*** 69,74 ****
  
  \begin{methoddesc}{getplist}{}
! Return the parameter list of the \code{content-type} header.  This is
! a list of strings.  For parameters of the form
  \samp{\var{key}=\var{value}}, \var{key} is converted to lower case but
  \var{value} is not.  For example, if the message contains the header
--- 69,74 ----
  
  \begin{methoddesc}{getplist}{}
! Return the parameter list of the \mailheader{Content-Type} header.
! This is a list of strings.  For parameters of the form
  \samp{\var{key}=\var{value}}, \var{key} is converted to lower case but
  \var{value} is not.  For example, if the message contains the header
***************
*** 86,110 ****
  
  \begin{methoddesc}{getencoding}{}
! Return the encoding specified in the \code{content-transfer-encoding}
! message header.  If no such header exists, return \code{'7bit'}.  The
! encoding is converted to lower case.
  \end{methoddesc}
  
  \begin{methoddesc}{gettype}{}
  Return the message type (of the form \samp{\var{type}/\var{subtype}})
! as specified in the \code{content-type} header.  If no such header
! exists, return \code{'text/plain'}.  The type is converted to lower
! case.
  \end{methoddesc}
  
  \begin{methoddesc}{getmaintype}{}
! Return the main type as specified in the \code{content-type} header.
! If no such header exists, return \code{'text'}.  The main type is
! converted to lower case.
  \end{methoddesc}
  
  \begin{methoddesc}{getsubtype}{}
! Return the subtype as specified in the \code{content-type} header.  If
! no such header exists, return \code{'plain'}.  The subtype is
! converted to lower case.
  \end{methoddesc}
--- 86,111 ----
  
  \begin{methoddesc}{getencoding}{}
! Return the encoding specified in the
! \mailheader{Content-Transfer-Encoding} message header.  If no such
! header exists, return \code{'7bit'}.  The encoding is converted to
! lower case.
  \end{methoddesc}
  
  \begin{methoddesc}{gettype}{}
  Return the message type (of the form \samp{\var{type}/\var{subtype}})
! as specified in the \mailheader{Content-Type} header.  If no such
! header exists, return \code{'text/plain'}.  The type is converted to
! lower case.
  \end{methoddesc}
  
  \begin{methoddesc}{getmaintype}{}
! Return the main type as specified in the \mailheader{Content-Type}
! header.  If no such header exists, return \code{'text'}.  The main
! type is converted to lower case.
  \end{methoddesc}
  
  \begin{methoddesc}{getsubtype}{}
! Return the subtype as specified in the \mailheader{Content-Type}
! header.  If no such header exists, return \code{'plain'}.  The subtype
! is converted to lower case.
  \end{methoddesc}

Index: libmimetypes.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libmimetypes.tex,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** libmimetypes.tex	2000/04/03 20:13:53	1.6
--- libmimetypes.tex	2001/08/03 18:39:36	1.7
***************
*** 21,35 ****
  \begin{funcdesc}{guess_type}{filename}
  Guess the type of a file based on its filename or URL, given by
! \var{filename}.
! The return value is a tuple \code{(\var{type}, \var{encoding})} where
! \var{type} is \code{None} if the type can't be guessed (no or unknown
! suffix) or a string of the form \code{'\var{type}/\var{subtype}'},
! usable for a MIME \code{content-type} header\indexii{MIME}{headers}; and 
! encoding is \code{None} for no encoding or the name of the program used
! to encode (e.g. \program{compress} or \program{gzip}).  The encoding
! is suitable for use as a \code{content-encoding} header,
! \emph{not} as a \code{content-transfer-encoding} header.  The mappings
! are table driven.  Encoding suffixes are case sensitive; type suffixes
! are first tried case sensitive, then case insensitive.
  \end{funcdesc}
  
--- 21,35 ----
  \begin{funcdesc}{guess_type}{filename}
  Guess the type of a file based on its filename or URL, given by
! \var{filename}.  The return value is a tuple \code{(\var{type},
! \var{encoding})} where \var{type} is \code{None} if the type can't be
! guessed (no or unknown suffix) or a string of the form
! \code{'\var{type}/\var{subtype}'}, usable for a MIME
! \mailheader{content-type} header\indexii{MIME}{headers}; and encoding
! is \code{None} for no encoding or the name of the program used to
! encode (e.g. \program{compress} or \program{gzip}).  The encoding is
! suitable for use as a \mailheader{Content-Encoding} header, \emph{not}
! as a \mailheader{Content-Transfer-Encoding} header.  The mappings are
! table driven.  Encoding suffixes are case sensitive; type suffixes are
! first tried case sensitive, then case insensitive.
  \end{funcdesc}
  
***************
*** 53,58 ****
  be a sequence of file names which should be used to augment the
  default type map.  If omitted, the file names to use are taken from
! \code{knownfiles}.  Each file named in \var{files} or
! \code{knownfiles} takes precedence over those named before it.
  Calling \function{init()} repeatedly is allowed.
  \end{funcdesc}
--- 53,58 ----
  be a sequence of file names which should be used to augment the
  default type map.  If omitted, the file names to use are taken from
! \constant{knownfiles}.  Each file named in \var{files} or
! \constant{knownfiles} takes precedence over those named before it.
  Calling \function{init()} repeatedly is allowed.
  \end{funcdesc}

Index: librfc822.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/librfc822.tex,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** librfc822.tex	2001/07/17 05:17:58	1.36
--- librfc822.tex	2001/08/03 18:39:36	1.37
***************
*** 73,88 ****
  
  \begin{funcdesc}{parseaddr}{address}
! Parse \var{address}, which should be the value of some address-containing
! field such as \code{To:} or \code{Cc:}, into its constituent
! ``realname'' and ``email address'' parts.  Returns a tuple of that
! information, unless the parse fails, in which case a 2-tuple of
! \code{(None, None)} is returned.
  \end{funcdesc}
  
  \begin{funcdesc}{dump_address_pair}{pair}
  The inverse of \method{parseaddr()}, this takes a 2-tuple of the form
! \code{(realname, email_address)} and returns the string value suitable
! for a \code{To:} or \code{Cc:} header.  If the first element of
! \var{pair} is false, then the second element is returned unmodified.
  \end{funcdesc}
  
--- 73,89 ----
  
  \begin{funcdesc}{parseaddr}{address}
! Parse \var{address}, which should be the value of some
! address-containing field such as \mailheader{To} or \mailheader{Cc},
! into its constituent ``realname'' and ``email address'' parts.
! Returns a tuple of that information, unless the parse fails, in which
! case a 2-tuple \code{(None, None)} is returned.
  \end{funcdesc}
  
  \begin{funcdesc}{dump_address_pair}{pair}
  The inverse of \method{parseaddr()}, this takes a 2-tuple of the form
! \code{(\var{realname}, \var{email_address})} and returns the string
! value suitable for a \mailheader{To} or \mailheader{Cc} header.  If
! the first element of \var{pair} is false, then the second element is
! returned unmodified.
  \end{funcdesc}
  
***************
*** 143,149 ****
  Returns a line's canonicalized fieldname (the dictionary key that will
  be used to index it) if the line is a legal \rfc{2822} header; otherwise
! returns None (implying that parsing should stop here and the line be
! pushed back on the input stream).  It is sometimes useful to override
! this method in a subclass.
  \end{methoddesc}
  
--- 144,150 ----
  Returns a line's canonicalized fieldname (the dictionary key that will
  be used to index it) if the line is a legal \rfc{2822} header; otherwise
! returns \code{None} (implying that parsing should stop here and the
! line be pushed back on the input stream).  It is sometimes useful to
! override this method in a subclass.
  \end{methoddesc}
  
***************
*** 201,206 ****
  strings.
  
! Example: If \var{m}'s first \code{From} header contains the string
! \code{'jack@cwi.nl (Jack Jansen)'}, then
  \code{m.getaddr('From')} will yield the pair
  \code{('Jack Jansen', 'jack@cwi.nl')}.
--- 202,207 ----
  strings.
  
! Example: If \var{m}'s first \mailheader{From} header contains the
! string \code{'jack@cwi.nl (Jack Jansen)'}, then
  \code{m.getaddr('From')} will yield the pair
  \code{('Jack Jansen', 'jack@cwi.nl')}.
***************
*** 212,216 ****
  \begin{methoddesc}{getaddrlist}{name}
  This is similar to \code{getaddr(\var{list})}, but parses a header
! containing a list of email addresses (e.g.\ a \code{To} header) and
  returns a list of \code{(\var{full name}, \var{email address})} pairs
  (even if there was only one address in the header).  If there is no
--- 213,217 ----
  \begin{methoddesc}{getaddrlist}{name}
  This is similar to \code{getaddr(\var{list})}, but parses a header
! containing a list of email addresses (e.g.\ a \mailheader{To} header) and
  returns a list of \code{(\var{full name}, \var{email address})} pairs
  (even if there was only one address in the header).  If there is no
***************
*** 218,223 ****
  
  If multiple headers exist that match the named header (e.g. if there
! are several \code{Cc} headers), all are parsed for addresses.  Any
! continuation lines the named headers contain are also parsed.
  \end{methoddesc}
  
--- 219,224 ----
  
  If multiple headers exist that match the named header (e.g. if there
! are several \mailheader{Cc} headers), all are parsed for addresses.
! Any continuation lines the named headers contain are also parsed.
  \end{methoddesc}
  

Index: liburllib.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/liburllib.tex,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** liburllib.tex	2001/07/23 19:16:22	1.37
--- liburllib.tex	2001/08/03 18:39:36	1.38
***************
*** 169,174 ****
  \code{urllib._urlopener} variable before calling the desired function.
  For example, applications may want to specify a different
! \code{user-agent} header than \class{URLopener} defines.  This can be
! accomplished with the following code:
  
  \begin{verbatim}
--- 169,174 ----
  \code{urllib._urlopener} variable before calling the desired function.
  For example, applications may want to specify a different
! \mailheader{User-Agent} header than \class{URLopener} defines.  This
! can be accomplished with the following code:
  
  \begin{verbatim}
***************
*** 188,194 ****
  
  By default, the \class{URLopener} class sends a
! \code{user-agent} header of \samp{urllib/\var{VVV}}, where
  \var{VVV} is the \module{urllib} version number.  Applications can
! define their own \code{user-agent} header by subclassing
  \class{URLopener} or \class{FancyURLopener} and setting the instance
  attribute \member{version} to an appropriate string value before the
--- 188,194 ----
  
  By default, the \class{URLopener} class sends a
! \mailheader{User-Agent} header of \samp{urllib/\var{VVV}}, where
  \var{VVV} is the \module{urllib} version number.  Applications can
! define their own \mailheader{User-Agent} header by subclassing
  \class{URLopener} or \class{FancyURLopener} and setting the instance
  attribute \member{version} to an appropriate string value before the
***************
*** 204,208 ****
  \class{FancyURLopener} subclasses \class{URLopener} providing default
  handling for the following HTTP response codes: 301, 302 or 401.  For
! 301 and 302 response codes, the \code{location} header is used to
  fetch the actual URL.  For 401 response codes (authentication
  required), basic HTTP authentication is performed.  For 301 and 302 response
--- 204,208 ----
  \class{FancyURLopener} subclasses \class{URLopener} providing default
  handling for the following HTTP response codes: 301, 302 or 401.  For
! 301 and 302 response codes, the \mailheader{Location} header is used to
  fetch the actual URL.  For 401 response codes (authentication
  required), basic HTTP authentication is performed.  For 301 and 302 response
***************
*** 258,265 ****
  HTTP\indexii{HTTP}{protocol} protocol provides type information in the
  reply header, which can be inspected by looking at the
! \code{content-type} header.  For the Gopher\indexii{Gopher}{protocol}
! protocol, type information is encoded in the URL; there is currently
! no easy way to extract it.  If the returned data is HTML, you can use
! the module \refmodule{htmllib}\refstmodindex{htmllib} to parse it.
  
  \item
--- 258,266 ----
  HTTP\indexii{HTTP}{protocol} protocol provides type information in the
  reply header, which can be inspected by looking at the
! \mailheader{Content-Type} header.  For the
! Gopher\indexii{Gopher}{protocol} protocol, type information is encoded
! in the URL; there is currently no easy way to extract it.  If the
! returned data is HTML, you can use the module
! \refmodule{htmllib}\refstmodindex{htmllib} to parse it.
  
  \item