Module mhlib :: Class Message
[hide private]
[frames] | no frames]

_ClassType Message

rfc822.Message --+    
                 |    
 mimetools.Message --+
                     |
                    Message
Known Subclasses:

Instance Methods [hide private]
 
__init__(self, f, n, fp=None)
Constructor.
 
__repr__(self)
String representation.
 
getheadertext(self, pred=None)
Return the message's header text as a string.
 
getbodytext(self, decode=1)
Return the message's body text as string.
 
getbodyparts(self)
Only for multipart messages: return the message's body as a list of SubMessage objects.
 
getbody(self)
Return body, either a string or a list of messages.

Inherited from mimetools.Message: getencoding, getmaintype, getparam, getparamnames, getplist, getsubtype, gettype, parseplist, parsetype

Inherited from rfc822.Message: __contains__, __delitem__, __getitem__, __iter__, __len__, __setitem__, __str__, get, getaddr, getaddrlist, getallmatchingheaders, getdate, getdate_tz, getfirstmatchingheader, getheader, getheaders, getrawheader, has_key, iscomment, isheader, islast, items, keys, readheaders, rewindbody, setdefault, values

Method Details [hide private]

__init__(self, f, n, fp=None)
(Constructor)

 

Constructor.

Overrides: rfc822.Message.__init__

getheadertext(self, pred=None)

 

Return the message's header text as a string. If an argument is specified, it is used as a filter predicate to decide which headers to return (its argument is the header name converted to lower case).

getbodytext(self, decode=1)

 

Return the message's body text as string. This undoes a Content-Transfer-Encoding, but does not interpret other MIME features (e.g. multipart messages). To suppress decoding, pass 0 as an argument.

getbodyparts(self)

 

Only for multipart messages: return the message's body as a list of SubMessage objects. Each submessage object behaves (almost) as a Message object.