Module mailbox :: Class MH
[hide private]
[frames] | no frames]

_ClassType MH

Mailbox --+
          |
         MH

An MH mailbox.

Instance Methods [hide private]
 
__init__(self, path, factory=None, create=True)
Initialize an MH instance.
 
add(self, message)
Add message and return assigned key.
 
remove(self, key)
Remove the keyed message; raise KeyError if it doesn't exist.
 
__setitem__(self, key, message)
Replace the keyed message; raise KeyError if it doesn't exist.
 
get_message(self, key)
Return a Message representation or raise a KeyError.
 
get_string(self, key)
Return a string representation or raise a KeyError.
 
get_file(self, key)
Return a file-like representation or raise a KeyError.
 
iterkeys(self)
Return an iterator over keys.
 
has_key(self, key)
Return True if the keyed message exists, False otherwise.
 
__len__(self)
Return a count of messages in the mailbox.
 
lock(self)
Lock the mailbox.
 
unlock(self)
Unlock the mailbox if it is locked.
 
flush(self)
Write any pending changes to the disk.
 
close(self)
Flush and close the mailbox.
 
list_folders(self)
Return a list of folder names.
 
get_folder(self, folder)
Return an MH instance for the named folder.
 
add_folder(self, folder)
Create a folder and return an MH instance representing it.
 
remove_folder(self, folder)
Delete the named folder, which must be empty.
 
get_sequences(self)
Return a name-to-key-list dictionary to define each sequence.
 
set_sequences(self, sequences)
Set sequences using the given name-to-key-list dictionary.
 
pack(self)
Re-name messages to eliminate numbering gaps.
 
_dump_sequences(self, message, key)
Inspect a new MHMessage and update sequences appropriately.

Inherited from Mailbox: __contains__, __delitem__, __getitem__, __iter__, clear, discard, get, items, iteritems, itervalues, keys, pop, popitem, update, values

Inherited from Mailbox (private): _dump_message

Method Details [hide private]

__init__(self, path, factory=None, create=True)
(Constructor)

 

Initialize an MH instance.

Overrides: Mailbox.__init__

add(self, message)

 

Add message and return assigned key.

Overrides: Mailbox.add

remove(self, key)

 

Remove the keyed message; raise KeyError if it doesn't exist.

Overrides: Mailbox.remove

__setitem__(self, key, message)
(Index assignment operator)

 

Replace the keyed message; raise KeyError if it doesn't exist.

Overrides: Mailbox.__setitem__

get_message(self, key)

 

Return a Message representation or raise a KeyError.

Overrides: Mailbox.get_message

get_string(self, key)

 

Return a string representation or raise a KeyError.

Overrides: Mailbox.get_string

get_file(self, key)

 

Return a file-like representation or raise a KeyError.

Overrides: Mailbox.get_file

iterkeys(self)

 

Return an iterator over keys.

Overrides: Mailbox.iterkeys

has_key(self, key)

 

Return True if the keyed message exists, False otherwise.

Overrides: Mailbox.has_key

__len__(self)
(Length operator)

 

Return a count of messages in the mailbox.

Overrides: Mailbox.__len__

lock(self)

 

Lock the mailbox.

Overrides: Mailbox.lock

unlock(self)

 

Unlock the mailbox if it is locked.

Overrides: Mailbox.unlock

flush(self)

 

Write any pending changes to the disk.

Overrides: Mailbox.flush

close(self)

 

Flush and close the mailbox.

Overrides: Mailbox.close

pack(self)

 

Re-name messages to eliminate numbering gaps. Invalidates keys.