[Spambayes-checkins] spambayes/spambayes message.py, 1.49.4.2, 1.49.4.3

Tony Meyer anadelonbrin at users.sourceforge.net
Fri Oct 15 08:01:06 CEST 2004


Update of /cvsroot/spambayes/spambayes/spambayes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20152/spambayes

Modified Files:
      Tag: release_1_0-branch
	message.py 
Log Message:
Backport fix for selecting message info database type when using sql etc.

Backport fix of StringIO import.

Index: message.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/message.py,v
retrieving revision 1.49.4.2
retrieving revision 1.49.4.3
diff -C2 -d -r1.49.4.2 -r1.49.4.3
*** message.py	23 Jun 2004 23:05:47 -0000	1.49.4.2
--- message.py	15 Oct 2004 06:01:01 -0000	1.49.4.3
***************
*** 105,109 ****
  from spambayes.tokenizer import tokenize
  
! from cStringIO import StringIO
  
  CRLF_RE = re.compile(r'\r\n|\r|\n')
--- 105,112 ----
  from spambayes.tokenizer import tokenize
  
! try:
!     import cStringIO as StringIO
! except ImportError:
!     import StringIO
  
  CRLF_RE = re.compile(r'\r\n|\r|\n')
***************
*** 207,217 ****
  message_info_db_name = get_pathname_option("Storage", "messageinfo_storage_file")
  if options["Storage", "persistent_use_database"] is True or \
!    options["Storage", "persistent_use_database"] == "True" or \
     options["Storage", "persistent_use_database"] == "dbm":
      msginfoDB = MessageInfoDB(message_info_db_name)
  elif options["Storage", "persistent_use_database"] is False or \
!      options["Storage", "persistent_use_database"] == "False" or \
       options["Storage", "persistent_use_database"] == "pickle":
      msginfoDB = MessageInfoPickle(message_info_db_name)
  
  class Message(email.Message.Message):
--- 210,226 ----
  message_info_db_name = get_pathname_option("Storage", "messageinfo_storage_file")
  if options["Storage", "persistent_use_database"] is True or \
! 
     options["Storage", "persistent_use_database"] == "dbm":
      msginfoDB = MessageInfoDB(message_info_db_name)
  elif options["Storage", "persistent_use_database"] is False or \
! 
       options["Storage", "persistent_use_database"] == "pickle":
      msginfoDB = MessageInfoPickle(message_info_db_name)
+ else:
+     # Ah - now, what?  Maybe the user has mysql or pgsql or zeo,
+     # or some other newfangled thing!  We don't know what to do
+     # in that case, so just use a pickle, since it's the safest
+     # option.
+     msginfoDB = MessageInfoPickle(message_info_db_name)
  
  class Message(email.Message.Message):



More information about the Spambayes-checkins mailing list