[Zope-CVS] CVS: Products/ZCTextIndex/tests - mhindex.py:1.14

Guido van Rossum guido@python.org
Wed, 29 May 2002 16:39:50 -0400


Update of /cvs-repository/Products/ZCTextIndex/tests
In directory cvs.zope.org:/tmp/cvs-serv455

Modified Files:
	mhindex.py 
Log Message:
Add "-b ALL" to built-index all folders.


=== Products/ZCTextIndex/tests/mhindex.py 1.13 => 1.14 ===
 
 To bulk index all messages from several folders:
-  mhindex.py [options] -b folder ...
+  mhindex.py [options] -b folder ...; the folder name ALL means all folders.
 
 To execute a single query:
   mhindex.py [options] query
@@ -419,6 +419,12 @@
                 uniqwords[word] = uniqwords.get(word, 0) + 1
 
     def bulkupdate(self, args):
+        if not args:
+            print "No folders specified; use ALL to bulk-index all folders"
+            return
+        if "ALL" in args:
+            i = args.index("ALL")
+            args[i:i+1] = self.mh.listfolders()
         for folder in args:
             if folder.startswith("+"):
                 folder = folder[1:]