[Spambayes-checkins] spambayes/spambayes msgs.py,1.3,1.4
Tony Meyer
anadelonbrin at users.sourceforge.net
Mon Oct 18 07:35:19 CEST 2004
Update of /cvsroot/spambayes/spambayes/spambayes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3585/spambayes
Modified Files:
msgs.py
Log Message:
Back out some changes that accidentally piggybacked their way in with the last check-in.
Index: msgs.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/msgs.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** msgs.py 18 Oct 2004 05:26:37 -0000 1.3
--- msgs.py 18 Oct 2004 05:35:10 -0000 1.4
***************
*** 46,70 ****
__slots__ = 'tag', 'directories', 'keep'
! def __init__(self, tag, directories, keep=None, use=None):
self.tag = tag
self.directories = directories
self.keep = keep
- self.use = use
def __str__(self):
return self.tag
- def __len__(self):
- """Number of messages in the stream, which is the number
- of files in the directory."""
- files = []
- for directory in self.directories:
- files.extend(os.listdir(directory))
- if self.keep is not None:
- del files[self.keep:]
- elif self.use is not None:
- files = files[self.use[0]:self.use[1]]
- return len(files)
-
def produce(self):
if self.keep is None:
--- 46,57 ----
__slots__ = 'tag', 'directories', 'keep'
! def __init__(self, tag, directories, keep=None):
self.tag = tag
self.directories = directories
self.keep = keep
def __str__(self):
return self.tag
def produce(self):
if self.keep is None:
***************
*** 80,87 ****
random.seed(hash(max(all)) ^ SEED) # reproducible across calls
random.shuffle(all)
! if self.use is None:
! del all[self.keep:]
! else:
! all = all[self.use[0]:self.use[1]]
all.sort() # seems to speed access on Win98!
for fname in all:
--- 67,71 ----
random.seed(hash(max(all)) ^ SEED) # reproducible across calls
random.shuffle(all)
! del all[self.keep:]
all.sort() # seems to speed access on Win98!
for fname in all:
More information about the Spambayes-checkins
mailing list