1
0
Fork 0

Adding file-based transports including Maildir, Mbox, Babyl, MH, and MMDF.

This commit is contained in:
Adam Coddington 2012-06-30 22:30:13 -07:00
parent 6a0305f944
commit aa0b79b36f
13 changed files with 174 additions and 77 deletions

View file

@ -0,0 +1,18 @@
class GenericFileMailbox(object):
_variant = None
_path = None
def __init__(self, path):
super(GenericFileMailbox, self).__init__()
self._path = path
def get_instance(self):
return self._variant(self._path)
def get_message(self):
repository = self.get_instance()
repository.lock()
for key, message in repository.items():
repository.remove(key)
yield message
repository.unlock()