1.1 --- a/test_scan.py Mon Oct 03 00:17:53 2011 +0200
1.2 +++ b/test_scan.py Mon Oct 03 00:34:30 2011 +0200
1.3 @@ -14,12 +14,20 @@
1.4
1.5 f = open(filename)
1.6 accessor = DelimitedRecord(fields, numeric=(numeric == "true"))
1.7 +
1.8 try:
1.9 for term in terms:
1.10 +
1.11 + # Convert the term to the appropriate type.
1.12 +
1.13 + term = accessor.convert(term)
1.14 +
1.15 + # Perform the search.
1.16 +
1.17 f.seek(0)
1.18
1.19 t = time.time()
1.20 - line = find_in_file(f, accessor.get_key, accessor.convert(term))
1.21 + line = find_in_file(f, accessor.get_key, term)
1.22 if line:
1.23 print "Found (at %s seconds)...\n%s" % (time.time() - t, line)
1.24 finally: