#NEWLINE# def path_select_files( paths , pattern = '*.xml' ) : #NEWLINE# #INDENT# if ( not paths ) : #NEWLINE# #INDENT# paths = [ REPORT_DIR ] #NEWLINE# #UNINDENT# selected = [ ] #NEWLINE# for pathname in paths : #NEWLINE# #INDENT# if os . path . isdir ( pathname ) : #NEWLINE# #INDENT# for ( root , dirs , files ) in os . walk ( pathname ) : #NEWLINE# #INDENT# for filename in files : #NEWLINE# #INDENT# if fnmatch ( filename , pattern ) : #NEWLINE# #INDENT# filename2 = os . path . join ( root , filename ) #NEWLINE# selected . append ( os . path . normpath ( paths ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( os . path . isfile ( pathname ) and fnmatch ( pathname , pattern ) ) : #NEWLINE# #INDENT# selected . append ( pathname ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return selected