parameters: (command)
return_statement: return command
docstring: If there are no slashes in the command given, this function
       searches the PATH env to find the given command, and converts it
       to an absolute path.  We have to do this because MSVS is looking
       for an actual file to launch a debugger on, not just a command
       line.  Note that this happens at GYP time, so anything needing to
       be built needs to have a full path.
docstring_summary: If there are no slashes in the command given, this function
       searches the PATH env to find the given command, and converts it
       to an absolute path.  We have to do this because MSVS is looking
       for an actual file to launch a debugger on, not just a command
       line.  Note that this happens at GYP time, so anything needing to
       be built needs to have a full path.
docstring_tokens: If there are no slashes in the command given this function searches the PATH env to find the given command and converts it to an absolute path . We have to do this because MSVS is looking for an actual file to launch a debugger on not just a command line . Note that this happens at GYP time so anything needing to be built needs to have a full path .
function: def _FindCommandInPath(command):
    """If there are no slashes in the command given, this function
       searches the PATH env to find the given command, and converts it
       to an absolute path.  We have to do this because MSVS is looking
       for an actual file to launch a debugger on, not just a command
       line.  Note that this happens at GYP time, so anything needing to
       be built needs to have a full path."""
    if '/' in command or '\\' in command:
      # If the command already has path elements (either relative or
      # absolute), then assume it is constructed properly.
      return command
    else:
      # Search through the path list and find an existing file that
      # we can access.
      paths = os.environ.get('PATH','').split(os.pathsep)
      for path in paths:
        item = os.path.join(path, command)
        if os.path.isfile(item) and os.access(item, os.X_OK):
          return item
    return command
function_tokens: def _FindCommandInPath ( command ) : if '/' in command or '\\' in command : # If the command already has path elements (either relative or # absolute), then assume it is constructed properly. return command else : # Search through the path list and find an existing file that # we can access. paths = os . environ . get ( 'PATH' , '' ) . split ( os . pathsep ) for path in paths : item = os . path . join ( path , command ) if os . path . isfile ( item ) and os . access ( item , os . X_OK ) : return item return command