document: enhance the test script for content index.

For the following commit, we need to test if the indexer really closes
the child process.

bzr revid: p_christ@hol.gr-20101209112455-8k13k9jshjxzmw4g
This commit is contained in:
P. Christeas 2010-12-09 13:24:55 +02:00
parent 0cb5ccb45d
commit 9023049b49
1 changed files with 12 additions and 1 deletions

View File

@ -3,9 +3,13 @@
import sys
import os
import glob
import time
import logging
from optparse import OptionParser
logging.basicConfig(level=logging.DEBUG)
parser = OptionParser()
parser.add_option("-q", "--quiet",
action="store_false", dest="verbose", default=True,
@ -15,6 +19,10 @@ parser.add_option("-C", "--content",
action="store_true", dest="docontent", default=False,
help="Disect content, rather than the file.")
parser.add_option("--delay",
action="store_true", dest="delay", default=False,
help="delay after the operation, to inspect child processes")
(options, args) = parser.parse_args()
import content_index, std_index
@ -34,9 +42,12 @@ for fname in args:
if options.verbose:
for line in res[:5]:
print line
if options.delay:
time.sleep(30)
except Exception,e:
import traceback
tb_s = reduce(lambda x, y: x+y, traceback.format_exception( sys.exc_type, sys.exc_value, sys.exc_traceback))
except KeyboardInterrupt:
print "Keyboard interrupt"
#eof