#NEWLINE# def combine_pex_coverage( root_dir , coverage_file_iter , unlink = True ) : #NEWLINE# #INDENT# combined = CoverageData ( basename = '.coverage' ) #NEWLINE# for filename in coverage_file_iter : #NEWLINE# #INDENT# cov = CoverageData ( basename = filename ) #NEWLINE# cov . read ( ) #NEWLINE# combined . add_line_data ( dict ( _iter_filter ( root_dir , cov . line_data ( ) ) ) ) #NEWLINE# combined . add_arc_data ( dict ( _iter_filter ( root_dir , cov . arc_data ( ) ) ) ) #NEWLINE# os . unlink ( filename ) #NEWLINE# #UNINDENT# prefix = os . path . join ( root_dir , 'pex/' ) #NEWLINE# non_pex = [ filename for filename in combined . lines if ( not filename . startswith ( prefix ) ) ] #NEWLINE# for filename in non_pex : #NEWLINE# #INDENT# combined . lines . pop ( filename ) #NEWLINE# #UNINDENT# non_pex = [ filename for filename in combined . arcs if ( not filename . startswith ( prefix ) ) ] #NEWLINE# for filename in non_pex : #NEWLINE# #INDENT# combined . arcs . pop ( filename ) #NEWLINE# #UNINDENT# combined . write ( ) #NEWLINE# return combined . filename