def import_modules_recursively(topdir):
 modules = []
 for (root, dirs, files) in os.walk(topdir):
  for file_ in files:
   if (file_[(-3):] != '.py'):
    continue
   module = file_[:(-3)]
   if (module == '__init__'):
    continue
   import_base = root.replace('/', '.')
   prefixlen = len(os.path.dirname(neutron.__file__))
   import_base = ('neutron' + import_base[prefixlen:])
   module = '.'.join([import_base, module])
   if (module not in sys.modules):
    importlib.import_module(module)
   modules.append(module)
 return modules

def import_modules_recursively ( topdir ) : modules = [ ] for ( root , dirs , files ) in os . walk ( topdir ) : for file_ in files : if ( file_ [ ( - 3 ) : ] != '.py' ) : continue module = file_ [ : ( - 3 ) ] if ( module == '__init__' ) : continue import_base = root . replace ( '/' , '.' ) prefixlen = len ( os . path . dirname ( neutron . __file__ ) ) import_base = ( 'neutron' + import_base [ prefixlen : ] ) module = '.' . join ( [ import_base , module ] ) if ( module not in sys . modules ) : importlib . import_module ( module ) modules . append ( module ) return modules
import and return all modules below the topdir directory .