[Zope-Checkins] CVS: Zope2 - keywords.py:1.1.2.2
Andreas Jung
andreas@yetix.digicool.com
Fri, 9 Mar 2001 10:06:04 -0500
Update of /mnt/cvs-repository/Zope2/lib/python/Products/ZCatalog/tests
In directory yetix:/work/Zope2/CatalogUnit/lib/python/Products/ZCatalog/tests
Modified Files:
Tag: Catalog-Unittest-Branch
keywords.py
Log Message:
untabbed version :-)
--- Updated File keywords.py in package test --
--- keywords.py 2001/03/07 12:48:43 1.1.2.1
+++ keywords.py 2001/03/09 15:06:02 1.1.2.2
@@ -2,31 +2,35 @@
class Keywords:
- def __init__(self):
- self.kw = []
-
- def build(self,mbox,limit):
-
- mb = mailbox.UnixMailbox(open(mbox))
- msg = mb.next()
-
- while msg and len(self.kw) < limit:
- sub = string.split( msg.dict.get("subject") , ' ')
- for f in sub:
- if not f in self.kw : self.kw.append(f)
-
- msg = mb.next()
-
- P = cPickle.Pickler(open('data/keywords','w'))
- P.dump(self.kw)
-
- def reload(self):
- P = cPickle.Unpickler(open('data/keywords','r'))
- self.kw = P.load()
-
-
- def keywords(self):
- return self.kw
-
-
-
+ def __init__(self):
+ self.kw = []
+
+ def build(self,mbox,limit):
+
+ mb = mailbox.UnixMailbox(open(mbox))
+ msg = mb.next()
+
+ while msg and len(self.kw) < limit:
+ sub = string.split( msg.dict.get("subject") , ' ')
+ for f in sub:
+ ok = 1
+ for c in f:
+ if not c in string.letters: ok=0
+
+ if ok==1 and not f in self.kw : self.kw.append(f)
+
+ msg = mb.next()
+
+ P = cPickle.Pickler(open('data/keywords','w'))
+ P.dump(self.kw)
+
+ def reload(self):
+ P = cPickle.Unpickler(open('data/keywords','r'))
+ self.kw = P.load()
+
+
+ def keywords(self):
+ return self.kw
+
+
+
--- Updated File keywords.py in package Zope2 --
--- keywords.py 2001/03/07 12:48:43 1.1.2.1
+++ keywords.py 2001/03/09 15:06:02 1.1.2.2
@@ -2,31 +2,35 @@
class Keywords:
- def __init__(self):
- self.kw = []
-
- def build(self,mbox,limit):
-
- mb = mailbox.UnixMailbox(open(mbox))
- msg = mb.next()
-
- while msg and len(self.kw) < limit:
- sub = string.split( msg.dict.get("subject") , ' ')
- for f in sub:
- if not f in self.kw : self.kw.append(f)
-
- msg = mb.next()
-
- P = cPickle.Pickler(open('data/keywords','w'))
- P.dump(self.kw)
-
- def reload(self):
- P = cPickle.Unpickler(open('data/keywords','r'))
- self.kw = P.load()
-
-
- def keywords(self):
- return self.kw
-
-
-
+ def __init__(self):
+ self.kw = []
+
+ def build(self,mbox,limit):
+
+ mb = mailbox.UnixMailbox(open(mbox))
+ msg = mb.next()
+
+ while msg and len(self.kw) < limit:
+ sub = string.split( msg.dict.get("subject") , ' ')
+ for f in sub:
+ ok = 1
+ for c in f:
+ if not c in string.letters: ok=0
+
+ if ok==1 and not f in self.kw : self.kw.append(f)
+
+ msg = mb.next()
+
+ P = cPickle.Pickler(open('data/keywords','w'))
+ P.dump(self.kw)
+
+ def reload(self):
+ P = cPickle.Unpickler(open('data/keywords','r'))
+ self.kw = P.load()
+
+
+ def keywords(self):
+ return self.kw
+
+
+