#NEWLINE# def find_binary( self , name ) : #NEWLINE# #INDENT# '\n        Finds the given executable name in the system PATH\n\n        :param name:\n            The exact name of the executable to find\n\n        :return:\n            The absolute path to the executable\n\n        :raises:\n            BinaryNotFoundError when the executable can not be found\n        ' #NEWLINE# dirs = os . environ [ 'PATH' ] . split ( os . pathsep ) #NEWLINE# if ( os . name != 'nt' ) : #NEWLINE# #INDENT# dirs . append ( '/usr/local/bin' ) #NEWLINE# #UNINDENT# for dir_ in dirs : #NEWLINE# #INDENT# path = os . path . join ( dir_ , name ) #NEWLINE# if os . path . exists ( path ) : #NEWLINE# #INDENT# return path #NEWLINE# #UNINDENT# #UNINDENT# raise BinaryNotFoundError ( ( 'The binary %s could not be located' % name ) )