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

_ClassType Maildir

Mailbox --+
          |
         Maildir

A qmail-style Maildir mailbox.

Instance Methods [hide private]
 
__init__(self, dirname, factory=<class rfc822.Message at 0x406f90bc>, create=True)
Initialize a Maildir 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_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.
 
flush(self)
Write any pending changes to disk.
 
lock(self)
Lock the mailbox.
 
unlock(self)
Unlock the mailbox if it is locked.
 
close(self)
Flush and close the mailbox.
 
list_folders(self)
Return a list of folder names.
 
get_folder(self, folder)
Return a Maildir instance for the named folder.
 
add_folder(self, folder)
Create a folder and return a Maildir instance representing it.
 
remove_folder(self, folder)
Delete the named folder, which must be empty.
 
clean(self)
Delete old files in "tmp".
 
_create_tmp(self)
Create a file in the tmp subdirectory and open and return it.
 
_refresh(self)
Update table of contents mapping.
 
_lookup(self, key)
Use TOC to return subpath for given key, or raise a KeyError.
 
next(self)
Return the next message in a one-time iteration.

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

Inherited from Mailbox (private): _dump_message

Class Variables [hide private]
  colon = ':'
  _count = 1
Method Details [hide private]

__init__(self, dirname, factory=<class rfc822.Message at 0x406f90bc>, create=True)
(Constructor)

 

Initialize a Maildir 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

discard(self, key)

 

If the keyed message exists, remove it.

Overrides: Mailbox.discard

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

flush(self)

 

Write any pending changes to disk.

Overrides: Mailbox.flush

lock(self)

 

Lock the mailbox.

Overrides: Mailbox.lock

unlock(self)

 

Unlock the mailbox if it is locked.

Overrides: Mailbox.unlock

close(self)

 

Flush and close the mailbox.

Overrides: Mailbox.close