This commit is contained in:
Barry Warsaw 2002-10-01 15:29:09 +00:00
parent 73ec98357e
commit dd868d32e0
3 changed files with 39 additions and 0 deletions

View File

@ -100,6 +100,7 @@ following differences:
\begin{itemize} \begin{itemize}
\item The \module{email.Header} and \module{email.Charset} modules \item The \module{email.Header} and \module{email.Charset} modules
have been added. have been added.
\item The pickle format for \class{Message} instances has changed. \item The pickle format for \class{Message} instances has changed.
Since this was never (and still isn't) formally defined, this Since this was never (and still isn't) formally defined, this
isn't considered a backward incompatibility. However if your isn't considered a backward incompatibility. However if your
@ -107,11 +108,13 @@ following differences:
aware that in \module{email} version 2, \class{Message} aware that in \module{email} version 2, \class{Message}
instances now have private variables \var{_charset} and instances now have private variables \var{_charset} and
\var{_default_type}. \var{_default_type}.
\item Several methods in the \class{Message} class have been \item Several methods in the \class{Message} class have been
deprecated, or their signatures changed. Also, many new methods deprecated, or their signatures changed. Also, many new methods
have been added. See the documentation for the \class{Message} have been added. See the documentation for the \class{Message}
class for details. The changes should be completely backward class for details. The changes should be completely backward
compatible. compatible.
\item The object structure has changed in the face of \item The object structure has changed in the face of
\mimetype{message/rfc822} content types. In \module{email} \mimetype{message/rfc822} content types. In \module{email}
version 1, such a type would be represented by a scalar payload, version 1, such a type would be represented by a scalar payload,
@ -132,29 +135,36 @@ following differences:
fine. You just need to make sure your code doesn't do a fine. You just need to make sure your code doesn't do a
\method{set_payload()} with a \class{Message} instance on a \method{set_payload()} with a \class{Message} instance on a
container with a content type of \mimetype{message/rfc822}. container with a content type of \mimetype{message/rfc822}.
\item The \class{Parser} constructor's \var{strict} argument was \item The \class{Parser} constructor's \var{strict} argument was
added, and its \method{parse()} and \method{parsestr()} methods added, and its \method{parse()} and \method{parsestr()} methods
grew a \var{headersonly} argument. The \var{strict} flag was grew a \var{headersonly} argument. The \var{strict} flag was
also added to functions \function{email.message_from_file()} also added to functions \function{email.message_from_file()}
and \function{email.message_from_string()}. and \function{email.message_from_string()}.
\item \method{Generator.__call__()} is deprecated; use \item \method{Generator.__call__()} is deprecated; use
\method{Generator.flatten()} instead. The \class{Generator} \method{Generator.flatten()} instead. The \class{Generator}
class has also grown the \method{clone()} method. class has also grown the \method{clone()} method.
\item The \class{DecodedGenerator} class in the \item The \class{DecodedGenerator} class in the
\module{email.Generator} module was added. \module{email.Generator} module was added.
\item The intermediate base classes \class{MIMENonMultipart} and \item The intermediate base classes \class{MIMENonMultipart} and
\class{MIMEMultipart} have been added, and interposed in the \class{MIMEMultipart} have been added, and interposed in the
class hierarchy for most of the other MIME-related derived class hierarchy for most of the other MIME-related derived
classes. classes.
\item The \var{_encoder} argument to the \class{MIMEText} constructor \item The \var{_encoder} argument to the \class{MIMEText} constructor
has been deprecated. Encoding now happens implicitly based has been deprecated. Encoding now happens implicitly based
on the \var{_charset} argument. on the \var{_charset} argument.
\item The following functions in the \module{email.Utils} module have \item The following functions in the \module{email.Utils} module have
been deprecated: \function{dump_address_pairs()}, been deprecated: \function{dump_address_pairs()},
\function{decode()}, and \function{encode()}. The following \function{decode()}, and \function{encode()}. The following
functions have been added to the module: functions have been added to the module:
\function{make_msgid()}, \function{decode_rfc2231()}, \function{make_msgid()}, \function{decode_rfc2231()},
\function{encode_rfc2231()}, and \function{decode_params()}. \function{encode_rfc2231()}, and \function{decode_params()}.
\item The non-public function \function{email.Iterators._structure()} \item The non-public function \function{email.Iterators._structure()}
was added. was added.
\end{itemize} \end{itemize}
@ -184,47 +194,65 @@ addition, the top-level package has the following differences:
\begin{itemize} \begin{itemize}
\item \function{messageFromString()} has been renamed to \item \function{messageFromString()} has been renamed to
\function{message_from_string()}. \function{message_from_string()}.
\item \function{messageFromFile()} has been renamed to \item \function{messageFromFile()} has been renamed to
\function{message_from_file()}. \function{message_from_file()}.
\end{itemize} \end{itemize}
The \class{Message} class has the following differences: The \class{Message} class has the following differences:
\begin{itemize} \begin{itemize}
\item The method \method{asString()} was renamed to \method{as_string()}. \item The method \method{asString()} was renamed to \method{as_string()}.
\item The method \method{ismultipart()} was renamed to \item The method \method{ismultipart()} was renamed to
\method{is_multipart()}. \method{is_multipart()}.
\item The \method{get_payload()} method has grown a \var{decode} \item The \method{get_payload()} method has grown a \var{decode}
optional argument. optional argument.
\item The method \method{getall()} was renamed to \method{get_all()}. \item The method \method{getall()} was renamed to \method{get_all()}.
\item The method \method{addheader()} was renamed to \method{add_header()}. \item The method \method{addheader()} was renamed to \method{add_header()}.
\item The method \method{gettype()} was renamed to \method{get_type()}. \item The method \method{gettype()} was renamed to \method{get_type()}.
\item The method\method{getmaintype()} was renamed to \item The method\method{getmaintype()} was renamed to
\method{get_main_type()}. \method{get_main_type()}.
\item The method \method{getsubtype()} was renamed to \item The method \method{getsubtype()} was renamed to
\method{get_subtype()}. \method{get_subtype()}.
\item The method \method{getparams()} was renamed to \item The method \method{getparams()} was renamed to
\method{get_params()}. \method{get_params()}.
Also, whereas \method{getparams()} returned a list of strings, Also, whereas \method{getparams()} returned a list of strings,
\method{get_params()} returns a list of 2-tuples, effectively \method{get_params()} returns a list of 2-tuples, effectively
the key/value pairs of the parameters, split on the \character{=} the key/value pairs of the parameters, split on the \character{=}
sign. sign.
\item The method \method{getparam()} was renamed to \method{get_param()}. \item The method \method{getparam()} was renamed to \method{get_param()}.
\item The method \method{getcharsets()} was renamed to \item The method \method{getcharsets()} was renamed to
\method{get_charsets()}. \method{get_charsets()}.
\item The method \method{getfilename()} was renamed to \item The method \method{getfilename()} was renamed to
\method{get_filename()}. \method{get_filename()}.
\item The method \method{getboundary()} was renamed to \item The method \method{getboundary()} was renamed to
\method{get_boundary()}. \method{get_boundary()}.
\item The method \method{setboundary()} was renamed to \item The method \method{setboundary()} was renamed to
\method{set_boundary()}. \method{set_boundary()}.
\item The method \method{getdecodedpayload()} was removed. To get \item The method \method{getdecodedpayload()} was removed. To get
similar functionality, pass the value 1 to the \var{decode} flag similar functionality, pass the value 1 to the \var{decode} flag
of the {get_payload()} method. of the {get_payload()} method.
\item The method \method{getpayloadastext()} was removed. Similar \item The method \method{getpayloadastext()} was removed. Similar
functionality functionality
is supported by the \class{DecodedGenerator} class in the is supported by the \class{DecodedGenerator} class in the
\refmodule{email.Generator} module. \refmodule{email.Generator} module.
\item The method \method{getbodyastext()} was removed. You can get \item The method \method{getbodyastext()} was removed. You can get
similar functionality by creating an iterator with similar functionality by creating an iterator with
\function{typed_subpart_iterator()} in the \function{typed_subpart_iterator()} in the
@ -251,12 +279,15 @@ The following modules and classes have been changed:
\item The \class{MIMEBase} class constructor arguments \var{_major} \item The \class{MIMEBase} class constructor arguments \var{_major}
and \var{_minor} have changed to \var{_maintype} and and \var{_minor} have changed to \var{_maintype} and
\var{_subtype} respectively. \var{_subtype} respectively.
\item The \code{Image} class/module has been renamed to \item The \code{Image} class/module has been renamed to
\code{MIMEImage}. The \var{_minor} argument has been renamed to \code{MIMEImage}. The \var{_minor} argument has been renamed to
\var{_subtype}. \var{_subtype}.
\item The \code{Text} class/module has been renamed to \item The \code{Text} class/module has been renamed to
\code{MIMEText}. The \var{_minor} argument has been renamed to \code{MIMEText}. The \var{_minor} argument has been renamed to
\var{_subtype}. \var{_subtype}.
\item The \code{MessageRFC822} class/module has been renamed to \item The \code{MessageRFC822} class/module has been renamed to
\code{MIMEMessage}. Note that an earlier version of \code{MIMEMessage}. Note that an earlier version of
\module{mimelib} called this class/module \code{RFC822}, but \module{mimelib} called this class/module \code{RFC822}, but

View File

@ -105,13 +105,19 @@ format:
\begin{itemize} \begin{itemize}
\item \code{type} -- Full MIME type of the non-\mimetype{text} part \item \code{type} -- Full MIME type of the non-\mimetype{text} part
\item \code{maintype} -- Main MIME type of the non-\mimetype{text} part \item \code{maintype} -- Main MIME type of the non-\mimetype{text} part
\item \code{subtype} -- Sub-MIME type of the non-\mimetype{text} part \item \code{subtype} -- Sub-MIME type of the non-\mimetype{text} part
\item \code{filename} -- Filename of the non-\mimetype{text} part \item \code{filename} -- Filename of the non-\mimetype{text} part
\item \code{description} -- Description associated with the \item \code{description} -- Description associated with the
non-\mimetype{text} part non-\mimetype{text} part
\item \code{encoding} -- Content transfer encoding of the \item \code{encoding} -- Content transfer encoding of the
non-\mimetype{text} part non-\mimetype{text} part
\end{itemize} \end{itemize}
The default value for \var{fmt} is \code{None}, meaning The default value for \var{fmt} is \code{None}, meaning

View File

@ -135,12 +135,14 @@ Here are some notes on the parsing semantics:
message object with a string payload. These objects will return message object with a string payload. These objects will return
\code{False} for \method{is_multipart()}. Their \code{False} for \method{is_multipart()}. Their
\method{get_payload()} method will return a string object. \method{get_payload()} method will return a string object.
\item All \mimetype{multipart} type messages will be parsed as a \item All \mimetype{multipart} type messages will be parsed as a
container message object with a list of sub-message objects for container message object with a list of sub-message objects for
their payload. The outer container message will return their payload. The outer container message will return
\code{True} for \method{is_multipart()} and their \code{True} for \method{is_multipart()} and their
\method{get_payload()} method will return the list of \method{get_payload()} method will return the list of
\class{Message} subparts. \class{Message} subparts.
\item Most messages with a content type of \mimetype{message/*} \item Most messages with a content type of \mimetype{message/*}
(e.g. \mimetype{message/deliver-status} and (e.g. \mimetype{message/deliver-status} and
\mimetype{message/rfc822}) will also be parsed as container \mimetype{message/rfc822}) will also be parsed as container