diff options
Diffstat (limited to 'Doc/library/email.message.rst')
-rw-r--r-- | Doc/library/email.message.rst | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/Doc/library/email.message.rst b/Doc/library/email.message.rst index edeed16..7f70898 100644 --- a/Doc/library/email.message.rst +++ b/Doc/library/email.message.rst @@ -45,8 +45,8 @@ Here are the methods of the :class:`Message` class: Note that this method is provided as a convenience and may not always format the message the way you want. For example, by default it mangles lines that begin with ``From``. For more flexibility, instantiate a - :class:`Generator` instance and use its :meth:`flatten` method directly. - For example:: + :class:`~email.generator.Generator` instance and use its :meth:`flatten` + method directly. For example:: from io import StringIO from email.generator import Generator @@ -122,11 +122,12 @@ Here are the methods of the :class:`Message` class: .. method:: set_charset(charset) Set the character set of the payload to *charset*, which can either be a - :class:`Charset` instance (see :mod:`email.charset`), a string naming a - character set, or ``None``. If it is a string, it will be converted to a - :class:`Charset` instance. If *charset* is ``None``, the ``charset`` - parameter will be removed from the :mailheader:`Content-Type` - header. Anything else will generate a :exc:`TypeError`. + :class:`~email.charset.Charset` instance (see :mod:`email.charset`), a + string naming a character set, or ``None``. If it is a string, it will + be converted to a :class:`~email.charset.Charset` instance. If *charset* + is ``None``, the ``charset`` parameter will be removed from the + :mailheader:`Content-Type` header. Anything else will generate a + :exc:`TypeError`. The message will be assumed to be of type :mimetype:`text/\*` encoded with *charset.input_charset*. It will be converted to *charset.output_charset* @@ -137,8 +138,8 @@ Here are the methods of the :class:`Message` class: .. method:: get_charset() - Return the :class:`Charset` instance associated with the message's - payload. + Return the :class:`~email.charset.Charset` instance associated with the + message's payload. The following methods implement a mapping-like interface for accessing the message's :rfc:`2822` headers. Note that there are some semantic differences @@ -445,7 +446,7 @@ Here are the methods of the :class:`Message` class: that header has no ``charset`` parameter, *failobj* is returned. Note that this method differs from :meth:`get_charset` which returns the - :class:`Charset` instance for the default encoding of the message body. + :class:`~email.charset.Charset` instance for the default encoding of the message body. .. method:: get_charsets([failobj]) @@ -495,10 +496,11 @@ Here are the methods of the :class:`Message` class: text can become visible. The *preamble* attribute contains this leading extra-armor text for MIME - documents. When the :class:`Parser` discovers some text after the headers - but before the first boundary string, it assigns this text to the - message's *preamble* attribute. When the :class:`Generator` is writing - out the plain text representation of a MIME message, and it finds the + documents. When the :class:`~email.parser.Parser` discovers some text + after the headers but before the first boundary string, it assigns this + text to the message's *preamble* attribute. When the + :class:`~email.generator.Generator` is writing out the plain text + representation of a MIME message, and it finds the message has a *preamble* attribute, it will write this text in the area between the headers and the first boundary. See :mod:`email.parser` and :mod:`email.generator` for details. |