Merged
This commit is contained in:
commit
5b2c876842
|
@ -46,15 +46,16 @@ Here are the methods of the :class:`Message` class:
|
||||||
be generated or modified).
|
be generated or modified).
|
||||||
|
|
||||||
Note that this method is provided as a convenience and may not always
|
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
|
format the message the way you want. For example, by default it does
|
||||||
lines that begin with ``From``. For more flexibility, instantiate a
|
not do the mangling of lines that begin with ``From`` that is
|
||||||
|
required by the unix mbox format. For more flexibility, instantiate a
|
||||||
:class:`~email.generator.Generator` instance and use its :meth:`flatten`
|
:class:`~email.generator.Generator` instance and use its :meth:`flatten`
|
||||||
method directly. For example::
|
method directly. For example::
|
||||||
|
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
from email.generator import Generator
|
from email.generator import Generator
|
||||||
fp = StringIO()
|
fp = StringIO()
|
||||||
g = Generator(fp, mangle_from_=False, maxheaderlen=60)
|
g = Generator(fp, mangle_from_=True, maxheaderlen=60)
|
||||||
g.flatten(msg)
|
g.flatten(msg)
|
||||||
text = fp.getvalue()
|
text = fp.getvalue()
|
||||||
|
|
||||||
|
|
|
@ -157,8 +157,7 @@ class Message:
|
||||||
header.
|
header.
|
||||||
|
|
||||||
This is a convenience method and may not generate the message exactly
|
This is a convenience method and may not generate the message exactly
|
||||||
as you intend because by default it mangles lines that begin with
|
as you intend. For more flexibility, use the flatten() method of a
|
||||||
"From ". For more flexibility, use the flatten() method of a
|
|
||||||
Generator instance.
|
Generator instance.
|
||||||
"""
|
"""
|
||||||
from email.generator import Generator
|
from email.generator import Generator
|
||||||
|
|
Loading…
Reference in New Issue