[Python-checkins] CVS: python/dist/src/Lib mailbox.py,1.23,1.24

Fred L. Drake python-dev@python.org
Fri, 22 Sep 2000 11:41:54 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory slayer.i.sourceforge.net:/tmp/cvs-serv18306

Modified Files:
	mailbox.py 
Log Message:

Maildir.__init__():  Use the correct filter for filenames, so that this
                     class conforms to the maildir specification.


Index: mailbox.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/mailbox.py,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -r1.23 -r1.24
*** mailbox.py	2000/09/14 14:44:43	1.23
--- mailbox.py	2000/09/22 18:41:50	1.24
***************
*** 183,199 ****
          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))
  
          # 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))
  
      def next(self):
--- 183,196 ----
          import string
          self.dirname = dirname
  
          # check for new mail
          newdir = os.path.join(self.dirname, 'new')
!         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')
!         boxes += [os.path.join(curdir, f)
!                   for f in os.listdir(curdir) if f[0] != '.']
  
      def next(self):