mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
Start making some markup adjustments; Barry has indicated he will work on
this before we finish the integration, along with some restructuring.
This commit is contained in:
parent
80d373cbd0
commit
a6a885b6aa
1 changed files with 17 additions and 17 deletions
|
|
@ -1,7 +1,7 @@
|
|||
% Copyright (C) 2001 Python Software Foundation
|
||||
% Author: barry@zope.com (Barry Warsaw)
|
||||
|
||||
\section{\module{email} --
|
||||
\section{\module{email} ---
|
||||
An email and MIME handling package}
|
||||
|
||||
\declaremodule{standard}{email}
|
||||
|
|
@ -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
|
||||
matched case-insensitively. There may also be a single
|
||||
\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
|
||||
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
|
||||
accessing the message headers, and an explicit interface for accessing
|
||||
|
|
@ -162,22 +162,22 @@ subclasses.
|
|||
key/value dictionary and is passed directly to
|
||||
\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
|
||||
\code{MIME-Version:} header (always set to \code{1.0}).
|
||||
\mailheader{MIME-Version} header (always set to \code{1.0}).
|
||||
\end{classdesc}
|
||||
|
||||
\begin{classdesc}{MIMEImage}{_imagedata\optional{, _subtype\optional{,
|
||||
_encoder\optional{, **_params}}}}
|
||||
|
||||
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
|
||||
data can be decoded by the standard Python module \refmodule{imghdr},
|
||||
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
|
||||
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.
|
||||
|
||||
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
|
|||
callable takes one argument, which is the \class{MIMEImage} instance.
|
||||
It should use \method{get_payload()} and \method{set_payload()} to
|
||||
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
|
||||
\refmodule{email.Encoders} module for a list of the built-in encoders.
|
||||
|
||||
|
|
@ -196,9 +196,9 @@ constructor.
|
|||
\begin{classdesc}{MIMEText}{_text\optional{, _subtype\optional{,
|
||||
_charset\optional{, _encoder}}}}
|
||||
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
|
||||
\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
|
||||
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
|
||||
|
|
@ -207,18 +207,18 @@ end with a newline.
|
|||
The \var{_encoding} argument is as with the \class{MIMEImage} class
|
||||
constructor, except that the default encoding for \class{MIMEText}
|
||||
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.
|
||||
\end{classdesc}
|
||||
|
||||
\begin{classdesc}{MIMEMessage}{_msg\optional{, _subtype}}
|
||||
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
|
||||
subclass thereof), otherwise a \exception{TypeError} is raised.
|
||||
|
||||
Optional \var{_subtype} sets the subtype of the message; it defaults
|
||||
to \code{rfc822}.
|
||||
to \mimetype{rfc822}.
|
||||
\end{classdesc}
|
||||
|
||||
\subsection{Encoders, Exceptions, Utilities, and Iterators}
|
||||
|
|
@ -308,7 +308,7 @@ The \class{Message} class has the following differences:
|
|||
|
||||
The \class{Parser} class has no differences in its public interface.
|
||||
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}
|
||||
subparts for each header block in the delivery status
|
||||
notification\footnote{Delivery Status Notifications (DSN) are defined
|
||||
|
|
@ -339,9 +339,9 @@ The following modules and classes have been changed:
|
|||
\refmodule{rfc822} on some case-insensitive file systems.
|
||||
|
||||
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
|
||||
subtype. \var{_subtype} defaults to \code{rfc822}.
|
||||
subtype. \var{_subtype} defaults to \mimetype{rfc822}.
|
||||
\end{itemize}
|
||||
|
||||
\module{mimelib} provided some utility functions in its
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue