[Spambayes-checkins] spambayes/pspam/pspam database.py, 1.1, 1.2 profile.py, 1.7, 1.8 options.py, 1.5, NONE

Tony Meyer anadelonbrin at users.sourceforge.net
Thu Dec 18 01:41:54 EST 2003


Update of /cvsroot/spambayes/spambayes/pspam/pspam
In directory sc8-pr-cvs1:/tmp/cvs-serv10266/pspam/pspam

Modified Files:
	database.py profile.py 
Removed Files:
	options.py 
Log Message:
Bring pspam into the modern spambayes world.  update.py, pop.py and scoremsg.py all seem to
work ok for me, with very limited testing.

Let the connection address be either a INET address (in the form "(server,port)", or a UNIX one.

Standardise the options code (move the options into the same place as all the rest, and dump
the pspam only file, which didn't work with the new OptionsClass anyway).  Note that the
options have no nice name or docstring, because I don't really know that I know enough to
fill those out.  They might vanish sometime anyway.

Index: database.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/pspam/pspam/database.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** database.py	4 Nov 2002 04:44:20 -0000	1.1
--- database.py	18 Dec 2003 06:41:52 -0000	1.2
***************
*** 1,3 ****
! from pspam.options import options
  
  import ZODB
--- 1,3 ----
! from spambayes.Options import options
  
  import ZODB
***************
*** 8,17 ****
  
  def logging():
!     os.environ["STUPID_LOG_FILE"] = options.event_log_file
!     os.environ["STUPID_LOG_SEVERITY"] = str(options.event_log_severity)
      zLOG.initialize()
  
  def open():
!     cs = ClientStorage(options.zeo_addr)
!     db = ZODB.DB(cs, cache_size=options.cache_size)
      return db
--- 8,22 ----
  
  def logging():
!     os.environ["STUPID_LOG_FILE"] = options["ZODB", "event_log_file"]
!     os.environ["STUPID_LOG_SEVERITY"] = str(options["ZODB",
!                                                     "event_log_severity"])
      zLOG.initialize()
  
  def open():
!     addr = options["ZODB", "zeo_addr"]
!     if addr and addr[0] == "(" and addr[-1] == ")":
!         s, p = tuple(addr[1:-1].split(',', 1))
!         addr = s, int(p)
!     cs = ClientStorage(addr)
!     db = ZODB.DB(cs, cache_size=options["ZODB", "cache_size"])
      return db

Index: profile.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/pspam/pspam/profile.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** profile.py	14 Jan 2003 05:38:20 -0000	1.7
--- profile.py	18 Dec 2003 06:41:52 -0000	1.8
***************
*** 10,14 ****
  
  from pspam.folder import Folder
! from pspam.options import options
  
  import os
--- 10,14 ----
  
  from pspam.folder import Folder
! from spambayes.Options import options
  
  import os
***************
*** 50,54 ****
          return "WordInfo(%r, %r)" % (self.spamcount, self.hamcount)
  
! class PMetaInfo(classifier.MetaInfo, Persistent):
      pass
  
--- 50,56 ----
          return "WordInfo(%r, %r)" % (self.spamcount, self.hamcount)
  
! ##class PMetaInfo(classifier.MetaInfo, Persistent):
! ##    pass
! class PMetaInfo(Persistent):
      pass
  

--- options.py DELETED ---





More information about the Spambayes-checkins mailing list