#NEWLINE# def filter_filenames( self , patterns , include ) : #NEWLINE# #INDENT# import fnmatch #NEWLINE# if isinstance ( patterns , str ) : #NEWLINE# #INDENT# patterns = ( patterns , ) #NEWLINE# #UNINDENT# new_stats = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ( filename , file_stats ) in _iteritems ( self . stats ) : #NEWLINE# #INDENT# if include : #NEWLINE# #INDENT# ignore = all ( ( ( not fnmatch . fnmatch ( filename , pattern ) ) for pattern in patterns ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ignore = any ( ( fnmatch . fnmatch ( filename , pattern ) for pattern in patterns ) ) #NEWLINE# #UNINDENT# if ignore : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# new_stats [ filename ] = file_stats #NEWLINE# #UNINDENT# self . stats = new_stats