Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(6)

Side by Side Diff: Doc/library/email.headerregistry.rst

Issue 18761: Fix internal doc references for the email package (Closed)
Patch Set: Created 6 years, 9 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Doc/library/email.errors.rst ('k') | Doc/library/email.iterators.rst » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 :mod:`email.headerregistry`: Custom Header Objects 1 :mod:`email.headerregistry`: Custom Header Objects
2 -------------------------------------------------- 2 --------------------------------------------------
3 3
4 .. module:: email.headerregistry 4 .. module:: email.headerregistry
5 :synopsis: Automatic Parsing of headers based on the field name 5 :synopsis: Automatic Parsing of headers based on the field name
6 6
7 .. moduleauthor:: R. David Murray <rdmurray@bitdance.com> 7 .. moduleauthor:: R. David Murray <rdmurray@bitdance.com>
8 .. sectionauthor:: R. David Murray <rdmurray@bitdance.com> 8 .. sectionauthor:: R. David Murray <rdmurray@bitdance.com>
9 9
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 *name* and *value* are passed to ``BaseHeader`` from the 49 *name* and *value* are passed to ``BaseHeader`` from the
50 :attr:`~email.policy.EmailPolicy.header_factory` call. The string value of 50 :attr:`~email.policy.EmailPolicy.header_factory` call. The string value of
51 any header object is the *value* fully decoded to unicode. 51 any header object is the *value* fully decoded to unicode.
52 52
53 This base class defines the following read-only properties: 53 This base class defines the following read-only properties:
54 54
55 55
56 .. attribute:: name 56 .. attribute:: name
57 57
58 The name of the header (the portion of the field before the ':'). This 58 The name of the header (the portion of the field before the ':'). This
59 is exactly the value passed in the :attr:`~EmailPolicy.header_factory` 59 is exactly the value passed in the
60 call for *name*; that is, case is preserved. 60 :attr:`~email.policy.EmailPolicy.header_factory` call for *name*; that
61 is, case is preserved.
61 62
62 63
63 .. attribute:: defects 64 .. attribute:: defects
64 65
65 A tuple of :exc:`~email.errors.HeaderDefect` instances reporting any 66 A tuple of :exc:`~email.errors.HeaderDefect` instances reporting any
66 RFC compliance problems found during parsing. The email package tries to 67 RFC compliance problems found during parsing. The email package tries to
67 be complete about detecting compliance issues. See the :mod:`errors` 68 be complete about detecting compliance issues. See the :mod:`~email.error s`
68 module for a discussion of the types of defects that may be reported. 69 module for a discussion of the types of defects that may be reported.
69 70
70 71
71 .. attribute:: max_count 72 .. attribute:: max_count
72 73
73 The maximum number of headers of this type that can have the same 74 The maximum number of headers of this type that can have the same
74 ``name``. A value of ``None`` means unlimited. The ``BaseHeader`` value 75 ``name``. A value of ``None`` means unlimited. The ``BaseHeader`` value
75 for this attribute is ``None``; it is expected that specialized header 76 for this attribute is ``None``; it is expected that specialized header
76 classes will override this value as needed. 77 classes will override this value as needed.
77 78
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 .. class:: SingleAddressHeader 224 .. class:: SingleAddressHeader
224 225
225 A subclass of :class:`.AddressHeader` that adds one 226 A subclass of :class:`.AddressHeader` that adds one
226 additional attribute: 227 additional attribute:
227 228
228 229
229 .. attribute:: address 230 .. attribute:: address
230 231
231 The single address encoded by the header value. If the header value 232 The single address encoded by the header value. If the header value
232 actually contains more than one address (which would be a violation of 233 actually contains more than one address (which would be a violation of
233 the RFC under the default :mod:`policy`), accessing this attribute will 234 the RFC under the default :mod:`~email.policy`), accessing this attribute
234 result in a :exc:`ValueError`. 235 will result in a :exc:`ValueError`.
235 236
236 237
237 Many of the above classes also have a ``Unique`` variant (for example, 238 Many of the above classes also have a ``Unique`` variant (for example,
238 ``UniqueUnstructuredHeader``). The only difference is that in the ``Unique`` 239 ``UniqueUnstructuredHeader``). The only difference is that in the ``Unique``
239 variant, :attr:`~.BaseHeader.max_count` is set to 1. 240 variant, :attr:`~.BaseHeader.max_count` is set to 1.
240 241
241 242
242 .. class:: MIMEVersionHeader 243 .. class:: MIMEVersionHeader
243 244
244 There is really only one valid value for the :mailheader:`MIME-Version` 245 There is really only one valid value for the :mailheader:`MIME-Version`
(...skipping 23 matching lines...) Expand all
268 also take a list of supplemental parameters, which have a common format. 269 also take a list of supplemental parameters, which have a common format.
269 This class serves as a base for all the MIME headers that take parameters. 270 This class serves as a base for all the MIME headers that take parameters.
270 271
271 .. attribute:: params 272 .. attribute:: params
272 273
273 A dictionary mapping parameter names to parameter values. 274 A dictionary mapping parameter names to parameter values.
274 275
275 276
276 .. class:: ContentTypeHeader 277 .. class:: ContentTypeHeader
277 278
278 A :class:`ParameterizedMIMEHheader` class that handles the 279 A :class:`ParameterizedMIMEHeader` class that handles the
279 :mailheader:`Content-Type` header. 280 :mailheader:`Content-Type` header.
280 281
281 .. attribute:: content_type 282 .. attribute:: content_type
282 283
283 The content type string, in the form ``maintype/subtype``. 284 The content type string, in the form ``maintype/subtype``.
284 285
285 .. attribute:: maintype 286 .. attribute:: maintype
286 287
287 .. attribute:: subtype 288 .. attribute:: subtype
288 289
289 290
290 .. class:: ContentDispositionHeader 291 .. class:: ContentDispositionHeader
291 292
292 A :class:`ParameterizedMIMEHheader` class that handles the 293 A :class:`ParameterizedMIMEHeader` class that handles the
293 :mailheader:`Content-Disposition` header. 294 :mailheader:`Content-Disposition` header.
294 295
295 .. attribute:: content-disposition 296 .. attribute:: content-disposition
296 297
297 ``inline`` and ``attachment`` are the only valid values in common use. 298 ``inline`` and ``attachment`` are the only valid values in common use.
298 299
299 300
300 .. class:: ContentTransferEncoding 301 .. class:: ContentTransferEncoding
301 302
302 Handles the :mailheader:`Content-Transfer-Encoding` header. 303 Handles the :mailheader:`Content-Transfer-Encoding` header.
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 A possibly empty tuple of :class:`.Address` objects representing the 444 A possibly empty tuple of :class:`.Address` objects representing the
444 addresses in the group. 445 addresses in the group.
445 446
446 .. method:: __str__() 447 .. method:: __str__()
447 448
448 The ``str`` value of a ``Group`` is formatted according to :rfc:`5322`, 449 The ``str`` value of a ``Group`` is formatted according to :rfc:`5322`,
449 but with no Content Transfer Encoding of any non-ASCII characters. If 450 but with no Content Transfer Encoding of any non-ASCII characters. If
450 ``display_name`` is none and there is a single ``Address`` in the 451 ``display_name`` is none and there is a single ``Address`` in the
451 ``addresses`` list, the ``str`` value will be the same as the ``str`` of 452 ``addresses`` list, the ``str`` value will be the same as the ``str`` of
452 that single ``Address``. 453 that single ``Address``.
OLDNEW
« no previous file with comments | « Doc/library/email.errors.rst ('k') | Doc/library/email.iterators.rst » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+