Changeset 128
- Timestamp:
- 10/29/07 18:10:44
- Files:
-
- pyconquer.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
pyconquer.py
r118 r128 392 392 tr.out.close() 393 393 394 def log_times(globpath, pattern=".*"): 395 """Return a dict of matching (float(time in ms), line) pairs for each file.""" 396 import glob 397 398 results = {} 399 for fname in glob.glob(globpath): 400 f = open(fname, 'rb') 401 lines = [] 402 for line in f.readlines(): 403 line = line.rstrip() 404 if line.endswith("ms") and re.search(pattern, line): 405 line = line.rsplit(" ", 1) 406 lines.append((float(line[1][:-2]), line[0])) 407 results[fname] = lines 408 f.close() 409 return results 394 410 395 411 # Verifier #
