[Spambayes-checkins] spambayes rebal.py,1.3,1.4
Skip Montanaro
montanaro@users.sourceforge.net
Sat, 21 Sep 2002 07:15:34 -0700
Update of /cvsroot/spambayes/spambayes
In directory usw-pr-cvs1:/tmp/cvs-serv27918
Modified Files:
rebal.py
Log Message:
provide a weak check against mixing ham and spam
Index: rebal.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/rebal.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** rebal.py 14 Sep 2002 03:32:47 -0000 1.3
--- rebal.py 21 Sep 2002 14:15:30 -0000 1.4
***************
*** 127,130 ****
--- 127,138 ----
return 1
+ # weak check against mixing ham and spam
+ if ("Ham" in setpfx and "Spam" in resdir or
+ "Spam" in setpfx and "Ham" in resdir):
+ yn = raw_input("Reservoir and Set dirs appear not to match. "
+ "Continue? (y/n) ")
+ if yn.lower()[0:1] != 'y':
+ return 1
+
# if necessary, migrate random files to the reservoir
for (dir, fs) in stuff: