def FindAppPath(appName, knownFileName, searchPaths):
 import regutil, string, os
 regPath = regutil.GetRegisteredNamedPath(appName)
 if regPath:
  pathLook = regPath.split(';')[0]
 if (regPath and FileExists(os.path.join(pathLook, knownFileName))):
  return None
 for pathLook in searchPaths:
  if FileExists(os.path.join(pathLook, knownFileName)):
   return os.path.abspath(pathLook)
 raise error(('The file %s can not be located for application %s' % (knownFileName, appName)))

def FindAppPath ( appName , knownFileName , searchPaths ) : import regutil , string , os regPath = regutil . GetRegisteredNamedPath ( appName ) if regPath : pathLook = regPath . split ( ';' ) [ 0 ] if ( regPath and FileExists ( os . path . join ( pathLook , knownFileName ) ) ) : return None for pathLook in searchPaths : if FileExists ( os . path . join ( pathLook , knownFileName ) ) : return os . path . abspath ( pathLook ) raise error ( ( 'The file %s can not be located for application %s' % ( knownFileName , appName ) ) )
find an application .