[Zope-CVS] CVS: Products/ZCTextIndex/tests - mailtest.py:1.1.2.12

Guido van Rossum guido@python.org
Wed, 1 May 2002 16:13:38 -0400


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

Modified Files:
      Tag: TextIndexDS9-branch
	mailtest.py 
Log Message:
Make -p0 special: it means don't pack at all.


=== Products/ZCTextIndex/tests/mailtest.py 1.1.2.11 => 1.1.2.12 ===
     -q query
     -i mailbox
-    -p NNN -- pack <data.fs> every NNN messages (default: at end only)
+    -p NNN -- pack <data.fs> every NNN messages (default: 500), and at end
+    -p 0 -- don't pack at all
 
 The script either indexes or queries depending on whether -q or -i is
 passed as an option.
@@ -84,7 +85,7 @@
         idx_time += i1 - i0
         if VERBOSE and i % 50 == 0:
             print i, "messages indexed"
-        if i % PACK_INTERVAL == 0:
+        if PACK_INTERVAL and i % PACK_INTERVAL == 0:
             if VERBOSE >= 2:
                 print "packing..."
             p0 = time.clock()
@@ -94,7 +95,7 @@
                 print "pack took %s sec" % (p1 - p0)
             pack_time += p1 - p0
 
-    if i % PACK_INTERVAL != 0:
+    if PACK_INTERVAL and i % PACK_INTERVAL != 0:
         if VERBOSE >= 2:
             print "packing one last time..."
         p0 = time.clock()