[Python-checkins] python/dist/src/Doc/lib emailmessage.tex,1.10,1.11

bwarsaw@users.sourceforge.net bwarsaw@users.sourceforge.net
Fri, 18 Apr 2003 16:03:57 -0700


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv18057

Modified Files:
	emailmessage.tex 
Log Message:
Added some more documentation to as_string() to make it clear that
it's a convenience only.  Give an example of what to do for more
flexibility.


Index: emailmessage.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailmessage.tex,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** emailmessage.tex	10 Mar 2003 16:13:50 -0000	1.10
--- emailmessage.tex	18 Apr 2003 23:03:53 -0000	1.11
***************
*** 37,40 ****
--- 37,54 ----
  \var{unixfrom} is \code{True}, the envelope header is included in the
  returned string.  \var{unixfrom} defaults to \code{False}.
+ 
+ Note that this method is provided as a convenience and may not always
+ format the message the way you want.  For more flexibility,
+ instantiate a \class{Generator} instance and use its
+ \method{flatten()} method directly.  For example:
+ 
+ \begin{verbatim}
+ from cStringIO import StringIO
+ from email.Generator import Generator
+ fp = StringIO()
+ g = Generator(mangle_from_=False, maxheaderlen=60)
+ g.flatten(msg)
+ text = fp.getvalue()
+ \end{verbatim}
  \end{methoddesc}