#NEWLINE# def lookup_module( filename ) : #NEWLINE# #INDENT# 'Helper function for break/clear parsing -- may be overridden.\n\n    lookupmodule() translates (possibly incomplete) file or module name\n    into an absolute file name.\n    ' #NEWLINE# import os #NEWLINE# import sys #NEWLINE# if ( os . path . isabs ( filename ) and os . path . exists ( filename ) ) : #NEWLINE# #INDENT# return filename #NEWLINE# #UNINDENT# f = os . path . join ( sys . path [ 0 ] , filename ) #NEWLINE# if os . path . exists ( f ) : #NEWLINE# #INDENT# return f #NEWLINE# #UNINDENT# ( root , ext ) = os . path . splitext ( filename ) #NEWLINE# if ( ext == '' ) : #NEWLINE# #INDENT# filename = ( filename + '.py' ) #NEWLINE# #UNINDENT# if os . path . isabs ( filename ) : #NEWLINE# #INDENT# return filename #NEWLINE# #UNINDENT# for dirname in sys . path : #NEWLINE# #INDENT# while os . path . islink ( dirname ) : #NEWLINE# #INDENT# dirname = os . readlink ( dirname ) #NEWLINE# #UNINDENT# fullname = os . path . join ( dirname , filename ) #NEWLINE# if os . path . exists ( dirname ) : #NEWLINE# #INDENT# return fullname #NEWLINE# #UNINDENT# #UNINDENT# return None