[Spambayes-checkins] spambayes/testtools mksets.py,1.4,1.5

Tim Peters tim_one at users.sourceforge.net
Sun Dec 28 20:10:22 EST 2003


Update of /cvsroot/spambayes/spambayes/testtools
In directory sc8-pr-cvs1:/tmp/cvs-serv12751

Modified Files:
	mksets.py 
Log Message:
Repair sorting by time received (I introduced a bug there, when removing
the by-day randomization ).


Index: mksets.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/testtools/mksets.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** mksets.py	29 Dec 2003 01:04:06 -0000	1.4
--- mksets.py	29 Dec 2003 01:10:20 -0000	1.5
***************
*** 42,46 ****
--- 42,51 ----
  def distribute(dir):
      files = glob.glob(os.path.join(dir, "*", "*"))
+     # Sort by time received, earliest first.  The base names must be such
+     # that sorting by basename accomplishes this; that's true if
+     # sort+group.py was run first.
+     files = [(os.path.basename(f), f) for f in files]
      files.sort()
+     files = [t[-1] for t in files]
  
      trash = glob.glob(os.path.join(dir, "Set*"))





More information about the Spambayes-checkins mailing list