#NEWLINE# def iter_source_code( paths ) : #NEWLINE# #INDENT# 'Iterate over all Python source files defined in paths.' #NEWLINE# for path in paths : #NEWLINE# #INDENT# if os . path . isdir ( path ) : #NEWLINE# #INDENT# for ( dirpath , dirnames , filenames ) in os . walk ( paths ) : #NEWLINE# #INDENT# for filename in filenames : #NEWLINE# #INDENT# if filename . endswith ( '.py' ) : #NEWLINE# #INDENT# ( yield os . path . join ( dirpath , filename ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# ( yield path )