[Spambayes-checkins] spambayes/spambayes Options.py,1.36,1.37

Tony Meyer anadelonbrin at users.sourceforge.net
Mon Apr 21 16:37:52 EDT 2003


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

Modified Files:
	Options.py 
Log Message:
Fix for [ spambayes-Bugs-725307 ].
This is not a nice fix, it's a quick hack that solves the problem.
However, those options that become sets no longer have
their values checked for validity.  This didn't happen before the
option changeover, so nothing is really lost, but a better fix
needs to be done.  I don't have time right now, but I'll do this
RSN.

Index: Options.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/Options.py,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** Options.py	20 Apr 2003 06:58:52 -0000	1.36
--- Options.py	21 Apr 2003 22:37:49 -0000	1.37
***************
*** 1136,1139 ****
--- 1136,1144 ----
                 return False
          elif type(self.allowed_values) == type(""):
+             # this is a complete hack - something better needs to
+             # be worked out for sets, but I don't have time just now.
+             import types
+             if type(value) == type(Set()):
+                 return True
              if self.multiple and value == "":
                  return True
***************
*** 1259,1262 ****
--- 1264,1270 ----
          '''Convert option from a string to the appropriate type.'''
          fetcher, converter = all_options[sect][opt]
+         # if it is already the correct type, we're done
+         if type(value) == type(converter("1")):
+             return value
          return converter(value)
  





More information about the Spambayes-checkins mailing list