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

Class Mailbox

Known Subclasses:

A group of messages in a particular place.

Instance Methods [hide private]
 
__init__(self, path, factory=None, create=True)
Initialize a Mailbox instance.
 
add(self, message)
Add message and return assigned key.
 
remove(self, key)
Remove the keyed message; raise KeyError if it doesn't exist.
 
__delitem__(self, key)
 
discard(self, key)
If the keyed message exists, remove it.
 
__setitem__(self, key, message)
Replace the keyed message; raise KeyError if it doesn't exist.
 
get(self, key, default=None)
Return the keyed message, or default if it doesn't exist.
 
__getitem__(self, key)
Return 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.
 
keys(self)
Return a list of keys.
 
itervalues(self)
Return an iterator over all messages.
 
__iter__(self)
 
values(self)
Return a list of messages.
 
iteritems(self)
Return an iterator over (key, message) tuples.
 
items(self)
Return a list of (key, message) tuples.
 
has_key(self, key)
Return True if the keyed message exists, False otherwise.
 
__contains__(self, key)
 
__len__(self)
Return a count of messages in the mailbox.
 
clear(self)
Delete all messages.
 
pop(self, key, default=None)
Delete the keyed message and return it, or default.
 
popitem(self)
Delete an arbitrary (key, message) pair and return it.
 
update(self, arg=None)
Change the messages that correspond to certain keys.
 
flush(self)
Write any pending changes to the disk.
 
lock(self)
Lock the mailbox.
 
unlock(self)
Unlock the mailbox if it is locked.
 
close(self)
Flush and close the mailbox.
 
_dump_message(self, message, target, mangle_from_=False)
Dump message contents to target file.
Method Details [hide private]

values(self)

 

Return a list of messages. Memory intensive.

items(self)

 

Return a list of (key, message) tuples. Memory intensive.