email.generator.DecodedGenerator

class email.generator.DecodedGenerator(outfp, mangle_from_=True, maxheaderlen=78, fmt=None)

This class, derived from Generator walks through all the subparts of a message. If the subpart is of main type text, then it prints the decoded payload of the subpart. Optional _mangle_from_ and maxheaderlen are as with the Generator base class.

If the subpart is not of main type text, optional fmt is a format string that is used instead of the message payload. fmt is expanded with the following keywords, %(keyword)s format:

  • type – Full MIME type of the non-text part
  • maintype – Main MIME type of the non-text part
  • subtype – Sub-MIME type of the non-text part
  • filename – Filename of the non-text part
  • description – Description associated with the non-text part
  • encoding – Content transfer encoding of the non-text part

The default value for fmt is None, meaning

[Non-text (%(type)s) part of message omitted, filename %(filename)s]
doc_python
2016-10-07 17:32:25
Comments
Leave a Comment

Please login to continue.