diff options
author | Fred Drake <fdrake@acm.org> | 2000-09-22 18:41:50 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2000-09-22 18:41:50 (GMT) |
commit | d9a8dec1356e19798492c2abb945c22f00299f33 (patch) | |
tree | b8109df03cc2504da70707cbf059f092335b38ac /Lib | |
parent | 1fa9365066492542c5679e393faa99507bd0d2bb (diff) | |
download | cpython-d9a8dec1356e19798492c2abb945c22f00299f33.zip cpython-d9a8dec1356e19798492c2abb945c22f00299f33.tar.gz cpython-d9a8dec1356e19798492c2abb945c22f00299f33.tar.bz2 |
Maildir.__init__(): Use the correct filter for filenames, so that this
class conforms to the maildir specification.
Diffstat (limited to 'Lib')
-rwxr-xr-x | Lib/mailbox.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Lib/mailbox.py b/Lib/mailbox.py index 5c6cc88..f010777 100755 --- a/Lib/mailbox.py +++ b/Lib/mailbox.py @@ -182,19 +182,16 @@ class Maildir: def __init__(self, dirname): import string self.dirname = dirname - self.boxes = [] # check for new mail newdir = os.path.join(self.dirname, 'new') - for file in os.listdir(newdir): - if len(string.split(file, '.')) > 2: - self.boxes.append(os.path.join(newdir, file)) + boxes = [os.path.join(newdir, f) + for f in os.listdir(newdir) if f[0] != '.'] # Now check for current mail in this maildir curdir = os.path.join(self.dirname, 'cur') - for file in os.listdir(curdir): - if len(string.split(file, '.')) > 2: - self.boxes.append(os.path.join(curdir, file)) + boxes += [os.path.join(curdir, f) + for f in os.listdir(curdir) if f[0] != '.'] def next(self): if not self.boxes: |