|
__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. |
|
|
|
|
|
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. |
|
|
|
|
|
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. |
|
|
|
|
|
__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. |
|
|