#NEWLINE# def load_modules( path ) : #NEWLINE# #INDENT# "\n    load_modules :: String -> [python.Module]\n\n    Given a filesystem path, import all modules under that path.\n\n    If the path is a file, import that file. If it's a directory, import all python files inside\n    that folder, in a non-recursive manner.\n    " #NEWLINE# if _is_python_file ( path ) : #NEWLINE# #INDENT# sys . path . insert ( 0 , os . path . dirname ( module ) ) #NEWLINE# module = import_module ( _get_module_name_from_path ( path ) ) #NEWLINE# return [ module ] #NEWLINE# #UNINDENT# return _get_modules ( path )