Package ProcImap :: Module ImapMessage :: Class ImapMessage
[hide private]
[frames] | no frames]

Class ImapMessage

source code

email.message.Message --+    
                        |    
          mailbox.Message --+
                            |
                           ImapMessage

Message with IMAP-specific properties. This class holds information 
about an IMAP email message that.
IMAP specific properties consist of IMAP flags, the internal
date (date when received by the server), and possibly the message
size.

Class specific attributes are:

internaldate    the date and time when the IMAP server received
                the message (time tuple)
size            number of bytes of the message, 0 if unknown

Instance Methods [hide private]
 
__init__(self, message=None)
If message is omitted, create new instance in a default, empty state.
source code
 
_get_explanation_from(self, message)
Copy specific state from message to self insofar as possible.
source code
 
_explain_to(self, message)
Copy IMAP-specific state to message insofar as possible.
source code
 
flagstring(self)
Return string for imap flags
source code
 
flags_from_string(self, flagstring)
Set the flags from a string as returned by self.flagstring()
source code
 
delete(self)
Add the \Deleted flag to the list of imap flags
source code
 
remove_imapflag(self, *flags)
Remove flags from the list of imap flags.
source code
 
add_imapflag(self, *flags)
Add a flag to the list of imap flags.
source code
 
set_imapflags(self, flags)
Set imap flags to flags
source code
 
get_imapflags(self)
Return a list of imap flags
source code
 
internaldatestring(self)
Return string for internaldate.
source code
 
internaldate_from_string(self, internaldatestring)
Set the internaldate from a string as it is returned by self.internaldatestring()
source code

Inherited from mailbox.Message (private): _become_message

Inherited from email.message.Message: __contains__, __delitem__, __getitem__, __len__, __setitem__, __str__, add_header, as_string, attach, del_param, get, get_all, get_boundary, get_charset, get_charsets, get_content_charset, get_content_maintype, get_content_subtype, get_content_type, get_default_type, get_filename, get_param, get_params, get_payload, get_unixfrom, has_key, is_multipart, items, keys, replace_header, set_boundary, set_charset, set_default_type, set_param, set_payload, set_type, set_unixfrom, values, walk

Inherited from email.message.Message (private): _get_params_preserve

Method Details [hide private]

__init__(self, message=None)
(Constructor)

source code 

If message is omitted, create new instance in a default, empty state. If message is an email.Message.Message instance, its contents are copied; furthermore, any format-specific information is converted insofar as possible if message is a Message instance. If message is a string or a file, it should contain an RFC 2822-compliant message, which is read and parsed. When a MaildirMessage instance is created based upon an mailbox.mboxMessage or mailbox.MMDFMessage instance, the Status: and X-Status: headers are omitted.

Overrides: email.message.Message.__init__

_explain_to(self, message)

source code 

Copy IMAP-specific state to message insofar as possible.

Overrides: mailbox.Message._explain_to

remove_imapflag(self, *flags)

source code 

Remove flags from the list of imap flags. Do nothing if the flag does not exist. Remember that this is a local modification.

add_imapflag(self, *flags)

source code 

Add a flag to the list of imap flags. You cannot add "\RECENT" as a flag.

internaldatestring(self)

source code 

Return string for internaldate. Return None if internaldate is None.