Commit dcf70957 authored by Fred Drake's avatar Fred Drake

Maildir.__init__(): Use the correct filter for filenames, so that this

                     class conforms to the maildir specification.
parent 8a038a40
...@@ -182,19 +182,16 @@ class Maildir: ...@@ -182,19 +182,16 @@ class Maildir:
def __init__(self, dirname): def __init__(self, dirname):
import string import string
self.dirname = dirname self.dirname = dirname
self.boxes = []
# check for new mail # check for new mail
newdir = os.path.join(self.dirname, 'new') newdir = os.path.join(self.dirname, 'new')
for file in os.listdir(newdir): boxes = [os.path.join(newdir, f)
if len(string.split(file, '.')) > 2: for f in os.listdir(newdir) if f[0] != '.']
self.boxes.append(os.path.join(newdir, file))
# Now check for current mail in this maildir # Now check for current mail in this maildir
curdir = os.path.join(self.dirname, 'cur') curdir = os.path.join(self.dirname, 'cur')
for file in os.listdir(curdir): boxes += [os.path.join(curdir, f)
if len(string.split(file, '.')) > 2: for f in os.listdir(curdir) if f[0] != '.']
self.boxes.append(os.path.join(curdir, file))
def next(self): def next(self):
if not self.boxes: if not self.boxes:
......
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