5 parser
= argparse
.ArgumentParser(description
='Remove the coverage data from a tracefile for all files matching the pattern.')
6 parser
.add_argument('--pattern', '-p', action
='append', help='the pattern of files to remove', required
=True)
7 parser
.add_argument('tracefile', help='the tracefile to remove the coverage data from')
8 parser
.add_argument('outfile', help='filename for the output to be written to')
10 args
= parser
.parse_args()
11 tracefile
= args
.tracefile
12 pattern
= args
.pattern
13 outfile
= args
.outfile
16 with
open(tracefile
, 'r') as f
:
17 with
open(outfile
, 'w') as wf
:
20 if line
.startswith("SF:") and p
in line
:
24 if line
== 'end_of_record\n':