#NEWLINE# def find_packages( path = '.' , base = '' , exclude = None ) : #NEWLINE# #INDENT# 'Find all packages in path' #NEWLINE# if ( not exclude ) : #NEWLINE# #INDENT# exclude = [ ] #NEWLINE# #UNINDENT# packages = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for item in os . listdir ( path ) : #NEWLINE# #INDENT# dir = os . path . join ( path , item ) #NEWLINE# if ( is_package ( dir ) and ( dir not in exclude ) ) : #NEWLINE# #INDENT# if base : #NEWLINE# #INDENT# module_name = '{base}.{item}' . format ( base = base , item = item ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# module_name = item #NEWLINE# #UNINDENT# packages [ module_name ] = dir #NEWLINE# packages . update ( find_packages ( dir , module_name ) ) #NEWLINE# #UNINDENT# #UNINDENT# return packages