[Spambayes-checkins]
spambayes storage.py,1.7,1.8 hammiebulk.py,1.5,1.6 Corpus.py,1.8,1.9
Richie Hindle
richiehindle at users.sourceforge.net
Sun Jan 5 14:32:48 EST 2003
Update of /cvsroot/spambayes/spambayes
In directory sc8-pr-cvs1:/tmp/cvs-serv29798
Modified Files:
storage.py hammiebulk.py Corpus.py
Log Message:
Added True, False and bool for 2.2-compatibility (thanks to François Granger).
Index: storage.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/storage.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** storage.py 5 Jan 2003 22:17:13 -0000 1.7
--- storage.py 5 Jan 2003 22:32:45 -0000 1.8
***************
*** 47,50 ****
--- 47,58 ----
__credits__ = "All the spambayes contributors."
+ try:
+ True, False
+ except NameError:
+ # Maintain compatibility with Python 2.2
+ True, False = 1, 0
+ def bool(val):
+ return not not val
+
import classifier
from Options import options
***************
*** 70,74 ****
classifier.Classifier.__init__(self)
self.db_name = db_name
! self.load()
def load(self):
--- 78,82 ----
classifier.Classifier.__init__(self)
self.db_name = db_name
! self.load()
def load(self):
Index: hammiebulk.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/hammiebulk.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** hammiebulk.py 2 Dec 2002 04:43:37 -0000 1.5
--- hammiebulk.py 5 Jan 2003 22:32:46 -0000 1.6
***************
*** 38,41 ****
--- 38,49 ----
"""
+ try:
+ True, False
+ except NameError:
+ # Maintain compatibility with Python 2.2
+ True, False = 1, 0
+ def bool(val):
+ return not not val
+
import sys
import os
Index: Corpus.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Corpus.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** Corpus.py 5 Jan 2003 22:26:20 -0000 1.8
--- Corpus.py 5 Jan 2003 22:32:46 -0000 1.9
***************
*** 83,86 ****
--- 83,94 ----
from __future__ import generators
+ try:
+ True, False
+ except NameError:
+ # Maintain compatibility with Python 2.2
+ True, False = 1, 0
+ def bool(val):
+ return not not val
+
import sys # for output of docstring
import time
More information about the Spambayes-checkins
mailing list