[Spambayes-checkins] spambayes mboxutils.py,1.2,1.3

Tim Peters tim_one@users.sourceforge.net
Sun Oct 27 21:35:02 2002


Update of /cvsroot/spambayes/spambayes
In directory usw-pr-cvs1:/tmp/cvs-serv7428

Modified Files:
	mboxutils.py 
Log Message:
Patch from Toby Dickenson to recognize Maildir directories.
Untested!


Index: mboxutils.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/mboxutils.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** mboxutils.py	4 Oct 2002 19:41:36 -0000	1.2
--- mboxutils.py	27 Oct 2002 21:35:00 -0000	1.3
***************
*** 11,14 ****
--- 11,16 ----
  /foo/bar/ -- (existing directory) a directory full of .txt and .lorien
               files
+ /foo/bar/ -- (existing directory with a cur/ subdirectory)
+              Maildir mailbox
  /foo/Mail/bar/ -- (existing directory with /Mail/ in its path)
               alternative way of spelling an MH mailbox
***************
*** 80,86 ****
  
      if os.path.isdir(name):
!         # XXX Bogus: use an MHMailbox if the pathname contains /Mail/,
!         # else a DirOfTxtFileMailbox.
!         if name.find("/Mail/") >= 0:
              mbox = mailbox.MHMailbox(name, _factory)
          else:
--- 82,90 ----
  
      if os.path.isdir(name):
!         # XXX Bogus: use a Maildir if /cur is a subdirectory, else a MHMailbox
!         # if the pathname contains /Mail/, else a DirOfTxtFileMailbox.
!         if os.path.exists(os.path.join(name, 'cur')):
!             mbox = mailbox.Maildir(name, _factory)
!         elif name.find("/Mail/") >= 0:
              mbox = mailbox.MHMailbox(name, _factory)
          else: