Commit a6a885b6 authored by Fred Drake's avatar Fred Drake

Start making some markup adjustments; Barry has indicated he will work on

this before we finish the integration, along with some restructuring.
parent 80d373cb
% Copyright (C) 2001 Python Software Foundation % Copyright (C) 2001 Python Software Foundation
% Author: barry@zope.com (Barry Warsaw) % Author: barry@zope.com (Barry Warsaw)
\section{\module{email} -- \section{\module{email} ---
An email and MIME handling package} An email and MIME handling package}
\declaremodule{standard}{email} \declaremodule{standard}{email}
...@@ -64,10 +64,10 @@ colon is not part of either the field name or the field value. ...@@ -64,10 +64,10 @@ colon is not part of either the field name or the field value.
Headers are stored and returned in case-preserving form but are Headers are stored and returned in case-preserving form but are
matched case-insensitively. There may also be a single matched case-insensitively. There may also be a single
\emph{Unix-From} header, also known as the envelope header or the \emph{Unix-From} header, also known as the envelope header or the
\code{From_} header. The payload is either a string in the case of \mailheader{From_} header. The payload is either a string in the case of
simple message objects, a list of \class{Message} objects for simple message objects, a list of \class{Message} objects for
multipart MIME documents, or a single \class{Message} instance for multipart MIME documents, or a single \class{Message} instance for
\code{message/rfc822} type objects. \mimetype{message/rfc822} type objects.
\class{Message} objects provide a mapping style interface for \class{Message} objects provide a mapping style interface for
accessing the message headers, and an explicit interface for accessing accessing the message headers, and an explicit interface for accessing
...@@ -162,22 +162,22 @@ subclasses. ...@@ -162,22 +162,22 @@ subclasses.
key/value dictionary and is passed directly to key/value dictionary and is passed directly to
\method{Message.add_header()}. \method{Message.add_header()}.
The \class{MIMEBase} class always adds a \code{Content-Type:} header The \class{MIMEBase} class always adds a \mailheader{Content-Type} header
(based on \var{_maintype}, \var{_subtype}, and \var{_params}), and a (based on \var{_maintype}, \var{_subtype}, and \var{_params}), and a
\code{MIME-Version:} header (always set to \code{1.0}). \mailheader{MIME-Version} header (always set to \code{1.0}).
\end{classdesc} \end{classdesc}
\begin{classdesc}{MIMEImage}{_imagedata\optional{, _subtype\optional{, \begin{classdesc}{MIMEImage}{_imagedata\optional{, _subtype\optional{,
_encoder\optional{, **_params}}}} _encoder\optional{, **_params}}}}
A subclass of \class{MIMEBase}, the \class{MIMEImage} class is used to A subclass of \class{MIMEBase}, the \class{MIMEImage} class is used to
create MIME message objects of major type \code{image}. create MIME message objects of major type \mimetype{image}.
\var{_imagedata} is a string containing the raw image data. If this \var{_imagedata} is a string containing the raw image data. If this
data can be decoded by the standard Python module \refmodule{imghdr}, data can be decoded by the standard Python module \refmodule{imghdr},
then the subtype will be automatically included in the then the subtype will be automatically included in the
\code{Content-Type:} header. Otherwise you can explicitly specify the \mailheader{Content-Type} header. Otherwise you can explicitly specify the
image subtype via the \var{_subtype} parameter. If the minor type could image subtype via the \var{_subtype} parameter. If the minor type could
not be guessed and \var{_subtype} was not given, then \code{TypeError} not be guessed and \var{_subtype} was not given, then \exception{TypeError}
is raised. is raised.
Optional \var{_encoder} is a callable (i.e. function) which will Optional \var{_encoder} is a callable (i.e. function) which will
...@@ -185,7 +185,7 @@ perform the actual encoding of the image data for transport. This ...@@ -185,7 +185,7 @@ perform the actual encoding of the image data for transport. This
callable takes one argument, which is the \class{MIMEImage} instance. callable takes one argument, which is the \class{MIMEImage} instance.
It should use \method{get_payload()} and \method{set_payload()} to It should use \method{get_payload()} and \method{set_payload()} to
change the payload to encoded form. It should also add any change the payload to encoded form. It should also add any
\code{Content-Transfer-Encoding:} or other headers to the message \mailheader{Content-Transfer-Encoding} or other headers to the message
object as necessary. The default encoding is \emph{Base64}. See the object as necessary. The default encoding is \emph{Base64}. See the
\refmodule{email.Encoders} module for a list of the built-in encoders. \refmodule{email.Encoders} module for a list of the built-in encoders.
...@@ -196,9 +196,9 @@ constructor. ...@@ -196,9 +196,9 @@ constructor.
\begin{classdesc}{MIMEText}{_text\optional{, _subtype\optional{, \begin{classdesc}{MIMEText}{_text\optional{, _subtype\optional{,
_charset\optional{, _encoder}}}} _charset\optional{, _encoder}}}}
A subclass of \class{MIMEBase}, the \class{MIMEText} class is used to A subclass of \class{MIMEBase}, the \class{MIMEText} class is used to
create MIME objects of major type \code{text}. \var{_text} is the string create MIME objects of major type \mimetype{text}. \var{_text} is the string
for the payload. \var{_subtype} is the minor type and defaults to for the payload. \var{_subtype} is the minor type and defaults to
\code{plain}. \var{_charset} is the character set of the text and is \mimetype{plain}. \var{_charset} is the character set of the text and is
passed as a parameter to the \class{MIMEBase} constructor; it defaults passed as a parameter to the \class{MIMEBase} constructor; it defaults
to \code{us-ascii}. No guessing or encoding is performed on the text to \code{us-ascii}. No guessing or encoding is performed on the text
data, but a newline is appended to \var{_text} if it doesn't already data, but a newline is appended to \var{_text} if it doesn't already
...@@ -207,18 +207,18 @@ end with a newline. ...@@ -207,18 +207,18 @@ end with a newline.
The \var{_encoding} argument is as with the \class{MIMEImage} class The \var{_encoding} argument is as with the \class{MIMEImage} class
constructor, except that the default encoding for \class{MIMEText} constructor, except that the default encoding for \class{MIMEText}
objects is one that doesn't actually modify the payload, but does set objects is one that doesn't actually modify the payload, but does set
the \code{Content-Transfer-Encoding:} header to \code{7bit} or the \mailheader{Content-Transfer-Encoding} header to \code{7bit} or
\code{8bit} as appropriate. \code{8bit} as appropriate.
\end{classdesc} \end{classdesc}
\begin{classdesc}{MIMEMessage}{_msg\optional{, _subtype}} \begin{classdesc}{MIMEMessage}{_msg\optional{, _subtype}}
A subclass of \class{MIMEBase}, the \class{MIMEMessage} class is used to A subclass of \class{MIMEBase}, the \class{MIMEMessage} class is used to
create MIME objects of main type \code{message}. \var{_msg} is used as create MIME objects of main type \mimetype{message}. \var{_msg} is used as
the payload, and must be an instance of class \class{Message} (or a the payload, and must be an instance of class \class{Message} (or a
subclass thereof), otherwise a \exception{TypeError} is raised. subclass thereof), otherwise a \exception{TypeError} is raised.
Optional \var{_subtype} sets the subtype of the message; it defaults Optional \var{_subtype} sets the subtype of the message; it defaults
to \code{rfc822}. to \mimetype{rfc822}.
\end{classdesc} \end{classdesc}
\subsection{Encoders, Exceptions, Utilities, and Iterators} \subsection{Encoders, Exceptions, Utilities, and Iterators}
...@@ -308,7 +308,7 @@ The \class{Message} class has the following differences: ...@@ -308,7 +308,7 @@ The \class{Message} class has the following differences:
The \class{Parser} class has no differences in its public interface. The \class{Parser} class has no differences in its public interface.
It does have some additional smarts to recognize It does have some additional smarts to recognize
\code{message/delivery-status} type messages, which it represents as \mimetype{message/delivery-status} type messages, which it represents as
a \class{Message} instance containing separate \class{Message} a \class{Message} instance containing separate \class{Message}
subparts for each header block in the delivery status subparts for each header block in the delivery status
notification\footnote{Delivery Status Notifications (DSN) are defined notification\footnote{Delivery Status Notifications (DSN) are defined
...@@ -339,9 +339,9 @@ The following modules and classes have been changed: ...@@ -339,9 +339,9 @@ The following modules and classes have been changed:
\refmodule{rfc822} on some case-insensitive file systems. \refmodule{rfc822} on some case-insensitive file systems.
Also, the \class{MIMEMessage} class now represents any kind of Also, the \class{MIMEMessage} class now represents any kind of
MIME message with main type \code{message}. It takes an MIME message with main type \mimetype{message}. It takes an
optional argument \var{_subtype} which is used to set the MIME optional argument \var{_subtype} which is used to set the MIME
subtype. \var{_subtype} defaults to \code{rfc822}. subtype. \var{_subtype} defaults to \mimetype{rfc822}.
\end{itemize} \end{itemize}
\module{mimelib} provided some utility functions in its \module{mimelib} provided some utility functions in its
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment