8 def handle_file(source_fname
, cov_fname
):
10 lines_blm
= subprocess
.Popen(["git", "blame", source_fname
], stdout
=subprocess
.PIPE
).stdout
.readlines()
11 lines_cov
= open(cov_fname
).readlines()
14 while re
.match(r
'\s*-:\s*0:', lines_cov
[0]):
17 if len(lines_blm
) != len(lines_cov
):
18 print >>sys
.stderr
, "MISMATCH IN NUMBER OF LINES in",source_fname
20 for b
,c
in zip(lines_blm
, lines_cov
):
21 m
= re
.match(r
'\s*([^\s:]+):', c
)
23 print >>sys
.stderr
, "CONFUSING LINE %r"% c
25 elif m
.group(1) == '-':
27 elif m
.group(1)[0] == '#':
29 elif m
.group(1)[0].isdigit():
32 print >>sys
.stderr
, "CONFUSING LINE %r"% c
38 SOURCES
= sys
.argv
[2:]
41 _
, base
= os
.path
.split(fn
)
42 cfn
= os
.path
.join(COV_DIR
, base
)
44 if os
.path
.exists(cfn
):
47 print >>sys
.stderr
, "NO FILE EXISTS CALLED ",cfn