Name
Generator
Synopsis
class Generator(outfp
,mangle_from_
=False,maxheaderlen
=78)
outfp
is a file or file-like object
supplying method write
. When
mangle_from_
is true,
g
prepends a '>
' to
any line in a message’s payload that starts with
'From
' This helps make the
message’s textual form more safely parseable.
g
wraps each header line at semicolons,
into physical lines of no more than
maxheaderlen
characters, for readability.
To use g
, just call it:
g
(m
,unixfrom
=False)
This emits m
in text form to
outfp
, like
outfp
.write(
m
.as_string(
unixfrom
))
.
Get Python in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.