44
44
:mod:`email.header.Header` class. Set to zero to disable header wrapping. The
45
45
default is 78, as recommended (but not required) by :rfc:`2822`.
47
The other public :class:`Generator` methods are:
50
.. method:: Generator.flatten(msg[, unixfrom])
52
Print the textual representation of the message object structure rooted at *msg*
53
to the output file specified when the :class:`Generator` instance was created.
54
Subparts are visited depth-first and the resulting text will be properly MIME
57
Optional *unixfrom* is a flag that forces the printing of the envelope header
58
delimiter before the first :rfc:`2822` header of the root message object. If
59
the root object has no envelope header, a standard one is crafted. By default,
60
this is set to ``False`` to inhibit the printing of the envelope delimiter.
62
Note that for subparts, no envelope header is ever printed.
64
.. versionadded:: 2.2.2
67
.. method:: Generator.clone(fp)
69
Return an independent clone of this :class:`Generator` instance with the exact
72
.. versionadded:: 2.2.2
75
.. method:: Generator.write(s)
77
Write the string *s* to the underlying file object, i.e. *outfp* passed to
78
:class:`Generator`'s constructor. This provides just enough file-like API for
79
:class:`Generator` instances to be used in extended print statements.
47
The other public :class:`Generator` methods are:
50
.. method:: flatten(msg[, unixfrom])
52
Print the textual representation of the message object structure rooted at
53
*msg* to the output file specified when the :class:`Generator` instance
54
was created. Subparts are visited depth-first and the resulting text will
55
be properly MIME encoded.
57
Optional *unixfrom* is a flag that forces the printing of the envelope
58
header delimiter before the first :rfc:`2822` header of the root message
59
object. If the root object has no envelope header, a standard one is
60
crafted. By default, this is set to ``False`` to inhibit the printing of
61
the envelope delimiter.
63
Note that for subparts, no envelope header is ever printed.
65
.. versionadded:: 2.2.2
70
Return an independent clone of this :class:`Generator` instance with the
73
.. versionadded:: 2.2.2
78
Write the string *s* to the underlying file object, i.e. *outfp* passed to
79
:class:`Generator`'s constructor. This provides just enough file-like API
80
for :class:`Generator` instances to be used in extended print statements.
81
82
As a convenience, see the methods :meth:`Message.as_string` and
82
83
``str(aMessage)``, a.k.a. :meth:`Message.__str__`, which simplify the generation