[Spambayes-checkins] spambayes/testtools timcv.py, 1.4, 1.5 timtest.py, 1.5, 1.6 weaktest.py, 1.4, 1.5

Tony Meyer anadelonbrin at users.sourceforge.net
Mon Jan 12 03:36:18 EST 2004


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

Modified Files:
	timcv.py timtest.py weaktest.py 
Log Message:
Well, it's been some time, and no-one disagreed, and three people liked the idea,
so here it is.

MAY BREAK THINGS!

>From now, path/file options are not relative to the current working directory,
they are relative to the last configuration file loaded.  This still defaults to the
current working directory (except on Windows with win32all, where it's still
the User Application Data directory).  So this should mean no noticeable change,
unless your last configuration file is not in the current working directory, and
your data is.

Index: timcv.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/testtools/timcv.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** timcv.py	5 Sep 2003 01:15:29 -0000	1.4
--- timcv.py	12 Jan 2004 08:36:15 -0000	1.5
***************
*** 56,60 ****
  
  
! from spambayes.Options import options
  from spambayes import TestDriver
  from spambayes import msgs
--- 56,60 ----
  
  
! from spambayes.Options import options, get_pathname_option
  from spambayes import TestDriver
  from spambayes import msgs
***************
*** 73,79 ****
      print options.display()
  
!     hamdirs  = [options["TestDriver", "ham_directories"] % \
                  i for i in range(1, nsets+1)]
!     spamdirs = [options["TestDriver", "spam_directories"] % \
                  i for i in range(1, nsets+1)]
  
--- 73,79 ----
      print options.display()
  
!     hamdirs  = [get_pathname_options("TestDriver", "ham_directories") % \
                  i for i in range(1, nsets+1)]
!     spamdirs = [get_pathname_options("TestDriver", "spam_directories") % \
                  i for i in range(1, nsets+1)]
  

Index: timtest.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/testtools/timtest.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** timtest.py	5 Sep 2003 01:15:29 -0000	1.5
--- timtest.py	12 Jan 2004 08:36:16 -0000	1.6
***************
*** 41,45 ****
  sys.path.insert(-1, os.path.dirname(os.getcwd()))
  
! from spambayes.Options import options
  from spambayes import TestDriver
  from spambayes import msgs
--- 41,45 ----
  sys.path.insert(-1, os.path.dirname(os.getcwd()))
  
! from spambayes.Options import options, get_pathname_option
  from spambayes import TestDriver
  from spambayes import msgs
***************
*** 58,64 ****
      print options.display()
  
!     spamdirs = [options["TestDriver", "spam_directories"] % \
                  i for i in range(1, nsets+1)]
!     hamdirs  = [options["TestDriver", "ham_directories"] % \
                  i for i in range(1, nsets+1)]
      spamhamdirs = zip(spamdirs, hamdirs)
--- 58,64 ----
      print options.display()
  
!     spamdirs = [get_pathname_option("TestDriver", "spam_directories") % \
                  i for i in range(1, nsets+1)]
!     hamdirs  = [get_pathname_option("TestDriver", "ham_directories") % \
                  i for i in range(1, nsets+1)]
      spamhamdirs = zip(spamdirs, hamdirs)

Index: weaktest.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/testtools/weaktest.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** weaktest.py	5 Sep 2003 01:15:29 -0000	1.4
--- weaktest.py	12 Jan 2004 08:36:16 -0000	1.5
***************
*** 34,38 ****
  import sys,os
  
! from spambayes.Options import options
  from spambayes import hammie, msgs, CostCounter
  
--- 34,38 ----
  import sys,os
  
! from spambayes.Options import options, get_pathname_option
  from spambayes import hammie, msgs, CostCounter
  
***************
*** 148,154 ****
      print options.display()
  
!     spamdirs = [options["TestDriver", "spam_directories"] % \
                  i for i in range(1, nsets+1)]
!     hamdirs  = [options["TestDriver", "ham_directories"] % \
                  i for i in range(1, nsets+1)]
  
--- 148,154 ----
      print options.display()
  
!     spamdirs = [get_pathname_option("TestDriver", "spam_directories") % \
                  i for i in range(1, nsets+1)]
!     hamdirs  = [get_pathname_option("TestDriver", "ham_directories") % \
                  i for i in range(1, nsets+1)]
  





More information about the Spambayes-checkins mailing list