#NEWLINE# def iterate_package_with_processor( package , processor ) : #NEWLINE# #INDENT# processor ( is_pkg ) #NEWLINE# for ( importer , modname , is_pkg ) in pkgutil . iter_modules ( package . __path__ ) : #NEWLINE# #INDENT# sub_package = import_module ( ( '%s.%s' % ( package . __package__ , modname ) ) ) #NEWLINE# if is_pkg : #NEWLINE# #INDENT# iterate_package ( sub_package , processor ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# processor ( sub_package )