tools/cr/cr/base/host.py
def SearchPath(cls, name, paths=[]):
    """Searches the PATH for an executable.

    Args:
      name: the name of the binary to search for.
    Returns:
      the set of executables found, or an empty list if none.
    """
    result = []
    extensions = ['']
    extensions.extend(os.environ.get('PATHEXT', '').split(os.pathsep))
    paths = [cr.context.Substitute(path) for path in paths if path]
    paths = paths + os.environ.get('PATH', '').split(os.pathsep)
    for path in paths:
      partial = os.path.join(path, name)
      for extension in extensions:
        filename = partial + extension
        if os.path.exists(filename) and filename not in result:
          result.append(filename)
    return result
Searches the PATH for an executable.

    Args:
      name: the name of the binary to search for.
    Returns:
      the set of executables found, or an empty list if none.
    
Searches the PATH for an executable.
Searches the PATH for an executable .
def SearchPath(cls, name, paths=[]):
    result = []
    extensions = ['']
    extensions.extend(os.environ.get('PATHEXT', '').split(os.pathsep))
    paths = [cr.context.Substitute(path) for path in paths if path]
    paths = paths + os.environ.get('PATH', '').split(os.pathsep)
    for path in paths:
      partial = os.path.join(path, name)
      for extension in extensions:
        filename = partial + extension
        if os.path.exists(filename) and filename not in result:
          result.append(filename)
    return result
def SearchPath ( cls , name , paths = [ ] ) : result = [ ] extensions = [ '' ] extensions . extend ( os . environ . get ( 'PATHEXT' , '' ) . split ( os . pathsep ) ) paths = [ cr . context . Substitute ( path ) for path in paths if path ] paths = paths + os . environ . get ( 'PATH' , '' ) . split ( os . pathsep ) for path in paths : partial = os . path . join ( path , name ) for extension in extensions : filename = partial + extension if os . path . exists ( filename ) and filename not in result : result . append ( filename ) return result
Searches the PATH for an executable.
Searches the PATH for an executable .
"""Searches the PATH for an executable.

    Args:
      name: the name of the binary to search for.
    Returns:
      the set of executables found, or an empty list if none.
    """
the set of executables found, or an empty list if none.
the set of executables found or an empty list if none .
cls
name
the name of the binary to search for.
the name of the binary to search for .
paths