Skip to content

Commit 3638e48

Browse files
committed
Merged revisions 71572 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r71572 | georg.brandl | 2009-04-13 15:13:25 +0200 (Mo, 13 Apr 2009) | 1 line python#5745: more linking for identifiers in email docs. ........
1 parent 540b45c commit 3638e48

8 files changed

Lines changed: 124 additions & 111 deletions

File tree

Doc/library/email.charset.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ Import this class from the :mod:`email.charset` module.
161161
charset to the output charset automatically. This is not useful for
162162
multibyte character sets, which have line length issues (multibyte
163163
characters must be split on a character, not a byte boundary); use the
164-
higher-level :class:`Header` class to deal with these issues (see
165-
:mod:`email.header`). *convert* defaults to ``False``.
164+
higher-level :class:`~email.header.Header` class to deal with these issues
165+
(see :mod:`email.header`). *convert* defaults to ``False``.
166166

167167
The type of encoding (base64 or quoted-printable) will be based on the
168168
*header_encoding* attribute.

Doc/library/email.encoders.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
:synopsis: Encoders for email message payloads.
66

77

8-
When creating :class:`Message` objects from scratch, you often need to encode
9-
the payloads for transport through compliant mail servers. This is especially
10-
true for :mimetype:`image/\*` and :mimetype:`text/\*` type messages containing
11-
binary data.
8+
When creating :class:`~email.message.Message` objects from scratch, you often
9+
need to encode the payloads for transport through compliant mail servers. This
10+
is especially true for :mimetype:`image/\*` and :mimetype:`text/\*` type messages
11+
containing binary data.
1212

1313
The :mod:`email` package provides some convenient encodings in its
1414
:mod:`encoders` module. These encoders are actually used by the
15-
:class:`MIMEAudio` and :class:`MIMEImage` class constructors to provide default
16-
encodings. All encoder functions take exactly one argument, the message object
17-
to encode. They usually extract the payload, encode it, and reset the payload
18-
to this newly encoded value. They should also set the
19-
:mailheader:`Content-Transfer-Encoding` header as appropriate.
15+
:class:`~email.mime.audio.MIMEAudio` and :class:`~email.mime.image.MIMEImage`
16+
class constructors to provide default encodings. All encoder functions take
17+
exactly one argument, the message object to encode. They usually extract the
18+
payload, encode it, and reset the payload to this newly encoded value. They
19+
should also set the :mailheader:`Content-Transfer-Encoding` header as appropriate.
2020

2121
Here are the encoding functions provided:
2222

Doc/library/email.errors.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ The following exception classes are defined in the :mod:`email.errors` module:
1717

1818
.. exception:: MessageParseError()
1919

20-
This is the base class for exceptions thrown by the :class:`Parser` class. It
21-
is derived from :exc:`MessageError`.
20+
This is the base class for exceptions thrown by the :class:`~email.parser.Parser`
21+
class. It is derived from :exc:`MessageError`.
2222

2323

2424
.. exception:: HeaderParseError()
@@ -55,11 +55,12 @@ The following exception classes are defined in the :mod:`email.errors` module:
5555
Since :meth:`Message.add_payload` is deprecated, this exception is rarely raised
5656
in practice. However the exception may also be raised if the :meth:`attach`
5757
method is called on an instance of a class derived from
58-
:class:`MIMENonMultipart` (e.g. :class:`MIMEImage`).
58+
:class:`~email.mime.nonmultipart.MIMENonMultipart` (e.g.
59+
:class:`~email.mime.image.MIMEImage`).
5960

60-
Here's the list of the defects that the :class:`FeedParser` can find while
61-
parsing messages. Note that the defects are added to the message where the
62-
problem was found, so for example, if a message nested inside a
61+
Here's the list of the defects that the :class:`~email.mime.parser.FeedParser`
62+
can find while parsing messages. Note that the defects are added to the message
63+
where the problem was found, so for example, if a message nested inside a
6364
:mimetype:`multipart/alternative` had a malformed header, that nested message
6465
object would have a defect, but the containing messages would not.
6566

Doc/library/email.generator.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ functionality of the bundled generator; you could write one from scratch
1616
yourself. However the bundled generator knows how to generate most email in a
1717
standards-compliant way, should handle MIME and non-MIME email messages just
1818
fine, and is designed so that the transformation from flat text, to a message
19-
structure via the :class:`Parser` class, and back to flat text, is idempotent
20-
(the input is identical to the output).
19+
structure via the :class:`~email.parser.Parser` class, and back to flat text,
20+
is idempotent (the input is identical to the output).
2121

2222
Here are the public methods of the :class:`Generator` class, imported from the
2323
:mod:`email.generator` module:
@@ -41,8 +41,8 @@ Here are the public methods of the :class:`Generator` class, imported from the
4141
Optional *maxheaderlen* specifies the longest length for a non-continued header.
4242
When a header line is longer than *maxheaderlen* (in characters, with tabs
4343
expanded to 8 spaces), the header will be split as defined in the
44-
:mod:`email.header.Header` class. Set to zero to disable header wrapping. The
45-
default is 78, as recommended (but not required) by :rfc:`2822`.
44+
:class:`~email.header.Header` class. Set to zero to disable header wrapping.
45+
The default is 78, as recommended (but not required) by :rfc:`2822`.
4646

4747
The other public :class:`Generator` methods are:
4848

Doc/library/email.header.rst

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ in its :mod:`email.header` and :mod:`email.charset` modules.
2121

2222
If you want to include non-ASCII characters in your email headers, say in the
2323
:mailheader:`Subject` or :mailheader:`To` fields, you should use the
24-
:class:`Header` class and assign the field in the :class:`Message` object to an
25-
instance of :class:`Header` instead of using a string for the header value.
26-
Import the :class:`Header` class from the :mod:`email.header` module. For
27-
example::
24+
:class:`Header` class and assign the field in the :class:`~email.message.Message`
25+
object to an instance of :class:`Header` instead of using a string for the header
26+
value. Import the :class:`Header` class from the :mod:`email.header` module.
27+
For example::
2828

2929
>>> from email.message import Message
3030
>>> from email.header import Header
@@ -39,9 +39,9 @@ example::
3939
Notice here how we wanted the :mailheader:`Subject` field to contain a non-ASCII
4040
character? We did this by creating a :class:`Header` instance and passing in
4141
the character set that the byte string was encoded in. When the subsequent
42-
:class:`Message` instance was flattened, the :mailheader:`Subject` field was
43-
properly :rfc:`2047` encoded. MIME-aware mail readers would show this header
44-
using the embedded ISO-8859-1 character.
42+
:class:`~email.message.Message` instance was flattened, the :mailheader:`Subject`
43+
field was properly :rfc:`2047` encoded. MIME-aware mail readers would show this
44+
header using the embedded ISO-8859-1 character.
4545

4646
Here is the :class:`Header` class description:
4747

@@ -81,10 +81,11 @@ Here is the :class:`Header` class description:
8181

8282
Append the string *s* to the MIME header.
8383

84-
Optional *charset*, if given, should be a :class:`Charset` instance (see
85-
:mod:`email.charset`) or the name of a character set, which will be
86-
converted to a :class:`Charset` instance. A value of ``None`` (the
87-
default) means that the *charset* given in the constructor is used.
84+
Optional *charset*, if given, should be a :class:`~email.charset.Charset`
85+
instance (see :mod:`email.charset`) or the name of a character set, which
86+
will be converted to a :class:`~email.charset.Charset` instance. A value
87+
of ``None`` (the default) means that the *charset* given in the constructor
88+
is used.
8889

8990
*s* may be an instance of :class:`bytes` or :class:`str`. If it is an
9091
instance of :class:`bytes`, then *charset* is the encoding of that byte

Doc/library/email.message.rst

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ Here are the methods of the :class:`Message` class:
4545
Note that this method is provided as a convenience and may not always
4646
format the message the way you want. For example, by default it mangles
4747
lines that begin with ``From``. For more flexibility, instantiate a
48-
:class:`Generator` instance and use its :meth:`flatten` method directly.
49-
For example::
48+
:class:`~email.generator.Generator` instance and use its :meth:`flatten`
49+
method directly. For example::
5050

5151
from io import StringIO
5252
from email.generator import Generator
@@ -122,11 +122,12 @@ Here are the methods of the :class:`Message` class:
122122
.. method:: set_charset(charset)
123123

124124
Set the character set of the payload to *charset*, which can either be a
125-
:class:`Charset` instance (see :mod:`email.charset`), a string naming a
126-
character set, or ``None``. If it is a string, it will be converted to a
127-
:class:`Charset` instance. If *charset* is ``None``, the ``charset``
128-
parameter will be removed from the :mailheader:`Content-Type`
129-
header. Anything else will generate a :exc:`TypeError`.
125+
:class:`~email.charset.Charset` instance (see :mod:`email.charset`), a
126+
string naming a character set, or ``None``. If it is a string, it will
127+
be converted to a :class:`~email.charset.Charset` instance. If *charset*
128+
is ``None``, the ``charset`` parameter will be removed from the
129+
:mailheader:`Content-Type` header. Anything else will generate a
130+
:exc:`TypeError`.
130131

131132
The message will be assumed to be of type :mimetype:`text/\*` encoded with
132133
*charset.input_charset*. It will be converted to *charset.output_charset*
@@ -137,8 +138,8 @@ Here are the methods of the :class:`Message` class:
137138

138139
.. method:: get_charset()
139140

140-
Return the :class:`Charset` instance associated with the message's
141-
payload.
141+
Return the :class:`~email.charset.Charset` instance associated with the
142+
message's payload.
142143

143144
The following methods implement a mapping-like interface for accessing the
144145
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:
445446
that header has no ``charset`` parameter, *failobj* is returned.
446447

447448
Note that this method differs from :meth:`get_charset` which returns the
448-
:class:`Charset` instance for the default encoding of the message body.
449+
:class:`~email.charset.Charset` instance for the default encoding of the message body.
449450

450451

451452
.. method:: get_charsets([failobj])
@@ -495,10 +496,11 @@ Here are the methods of the :class:`Message` class:
495496
text can become visible.
496497

497498
The *preamble* attribute contains this leading extra-armor text for MIME
498-
documents. When the :class:`Parser` discovers some text after the headers
499-
but before the first boundary string, it assigns this text to the
500-
message's *preamble* attribute. When the :class:`Generator` is writing
501-
out the plain text representation of a MIME message, and it finds the
499+
documents. When the :class:`~email.parser.Parser` discovers some text
500+
after the headers but before the first boundary string, it assigns this
501+
text to the message's *preamble* attribute. When the
502+
:class:`~email.generator.Generator` is writing out the plain text
503+
representation of a MIME message, and it finds the
502504
message has a *preamble* attribute, it will write this text in the area
503505
between the headers and the first boundary. See :mod:`email.parser` and
504506
:mod:`email.generator` for details.

0 commit comments

Comments
 (0)