Package email :: Module generator :: Class DecodedGenerator
[hide private]
[frames] | no frames]

_ClassType DecodedGenerator

Generator --+
            |
           DecodedGenerator

Generator a text representation of a message.

Like the Generator base class, except that non-text parts are substituted with a format string representing the part.

Instance Methods [hide private]
 
__init__(self, outfp, mangle_from_=True, maxheaderlen=78, fmt=None)
Like Generator.__init__() except that an additional optional argument is allowed.
 
_dispatch(self, msg)

Inherited from Generator: clone, flatten, write

Method Details [hide private]

__init__(self, outfp, mangle_from_=True, maxheaderlen=78, fmt=None)
(Constructor)

 

Like Generator.__init__() except that an additional optional argument is allowed.

Walks through all subparts of a message. If the subpart is of main type `text', then it prints the decoded payload of the subpart.

Otherwise, fmt is a format string that is used instead of the message payload. fmt is expanded with the following keywords (in %(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]

Overrides: Generator.__init__

_dispatch(self, msg)

 
Overrides: Generator._dispatch