[Email-SIG] Make reply

Martijn Pieters mj at zopatista.com
Fri Apr 14 20:31:29 CEST 2006


Oleg Broytmann wrote:
> Barry, woulnt't it be a nice addition?
> 
> def make_reply(body, quote_str="> "):
>     return '\n'.join([quote_str + line for line in body.split('\n')])

I think there is a bit more to quoting than just prepending a quotemark;
it also depends on the email format.

I guess that that function (with splitlines() perhaps) would do for
"text/plain"; but for "text/plain; format=flowed" (note the qualifier,
quote formatting is explicitly defined in an RFC, and you might want to
 use a specialized module to handle that.

<plug mode="blatant">I have such a module at the ready at:

  http://www.zopatista.com/projects/formatflowed

which handles correct wragging as well.</plug>

Martijn Pieters


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://mail.python.org/pipermail/email-sig/attachments/20060414/159cce05/attachment.pgp 


More information about the Email-SIG mailing list