def getEngineFilename():
 base_search_path = os.path.dirname(inspect.getfile(getEngineFilename))
 search_filename = 'CuraEngine'
 if (platform.system() == 'Windows'):
  search_filename += '.exe'
  if (version.isDevVersion() and os.path.exists('C:/Software/Cura_SteamEngine/_bin/Release/Cura_SteamEngine.exe')):
   return 'C:/Software/Cura_SteamEngine/_bin/Release/Cura_SteamEngine.exe'
 for n in xrange(0, 10):
  full_filename = os.path.abspath(os.path.join(base_search_path, '/'.join((['..'] * n)), search_filename))
  if os.path.isfile(full_filename):
   return full_filename
  full_filename = os.path.abspath(os.path.join(base_search_path, '/'.join((['..'] * n)), 'CuraEngine', search_filename))
  if os.path.isfile(full_filename):
   return full_filename
 if os.path.isfile('/usr/bin/CuraEngine'):
  return '/usr/bin/CuraEngine'
 if os.path.isfile('/usr/local/bin/CuraEngine'):
  return '/usr/local/bin/CuraEngine'
 return ''

def getEngineFilename ( ) : base_search_path = os . path . dirname ( inspect . getfile ( getEngineFilename ) ) search_filename = 'CuraEngine' if ( platform . system ( ) == 'Windows' ) : search_filename += '.exe' if ( version . isDevVersion ( ) and os . path . exists ( 'C:/Software/Cura_SteamEngine/_bin/Release/Cura_SteamEngine.exe' ) ) : return 'C:/Software/Cura_SteamEngine/_bin/Release/Cura_SteamEngine.exe' for n in xrange ( 0 , 10 ) : full_filename = os . path . abspath ( os . path . join ( base_search_path , '/' . join ( ( [ '..' ] * n ) ) , search_filename ) ) if os . path . isfile ( full_filename ) : return full_filename full_filename = os . path . abspath ( os . path . join ( base_search_path , '/' . join ( ( [ '..' ] * n ) ) , 'CuraEngine' , search_filename ) ) if os . path . isfile ( full_filename ) : return full_filename if os . path . isfile ( '/usr/bin/CuraEngine' ) : return '/usr/bin/CuraEngine' if os . path . isfile ( '/usr/local/bin/CuraEngine' ) : return '/usr/local/bin/CuraEngine' return ''
finds and returns the path to the current engine executable .