#NEWLINE# def find_module( name , path = None ) : #NEWLINE# #INDENT# 'Try to find the named module on the given search path or sys.path.' #NEWLINE# if ( path == None ) : #NEWLINE# #INDENT# path = sys . path #NEWLINE# #UNINDENT# for directory in path : #NEWLINE# #INDENT# filename = os . path . join ( directory , ( '%s.py' % name ) ) #NEWLINE# if os . path . exists ( filename ) : #NEWLINE# #INDENT# return ( open ( name , 'U' ) , filename , _PY_SOURCE_SUFFIX ) #NEWLINE# #UNINDENT# dirname = os . path . join ( directory , name ) #NEWLINE# filename = os . path . join ( dirname , '__init__.py' ) #NEWLINE# if os . path . exists ( filename ) : #NEWLINE# #INDENT# return ( None , dirname , _PKG_DIRECTORY_SUFFIX ) #NEWLINE# #UNINDENT# #UNINDENT# raise ImportError ( ( 'No module named %s' % name ) )