Commit 72987a4b authored by Fred Drake's avatar Fred Drake

Make the Mailbox objects support iteration -- they already had the

appropriate next() method, and this is what people really want to do with
these objects in practice.
parent eacdec6b
......@@ -14,6 +14,9 @@ class _Mailbox:
self.seekp = 0
self.factory = factory
def __iter__(self):
return self
def next(self):
while 1:
self.fp.seek(self.seekp)
......@@ -191,6 +194,9 @@ class MHMailbox:
self.boxes = map(str, list)
self.factory = factory
def __iter__(self):
return self
def next(self):
if not self.boxes:
return None
......@@ -219,6 +225,9 @@ class Maildir:
self.boxes = boxes
def __iter__(self):
return self
def next(self):
if not self.boxes:
return None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment