tools/symsrc/source_index.py
def RunCommand(*cmd, **kwargs):
  """Runs a command.

  Returns what have been printed to stdout by this command.

  kwargs:
    raise_on_failure: Indicates if an exception should be raised on failure, if
        set to false then the function will return None.
  """
  kwargs.setdefault('stdin', subprocess.PIPE)
  kwargs.setdefault('stdout', subprocess.PIPE)
  kwargs.setdefault('stderr', subprocess.PIPE)
  kwargs.setdefault('universal_newlines', True)
  raise_on_failure = kwargs.pop('raise_on_failure', True)

  proc = subprocess.Popen(cmd, **kwargs)
  ret, err = proc.communicate()
  if proc.returncode != 0:
    if raise_on_failure:
      print('Error: %s' % err)
      raise subprocess.CalledProcessError(proc.returncode, cmd)
    return

  ret = (ret or '').rstrip('\n')
  return ret
Runs a command.

  Returns what have been printed to stdout by this command.

  kwargs:
    raise_on_failure: Indicates if an exception should be raised on failure, if
        set to false then the function will return None.
  
Runs a command.
Returns what have been printed to stdout by this command.

Indicates if an exception should be raised on failure, if
set to false then the function will return None.
Runs a command . Returns what have been printed to stdout by this command . Indicates if an exception should be raised on failure if set to false then the function will return None .
def RunCommand(*cmd, **kwargs):
  kwargs.setdefault('stdin', subprocess.PIPE)
  kwargs.setdefault('stdout', subprocess.PIPE)
  kwargs.setdefault('stderr', subprocess.PIPE)
  kwargs.setdefault('universal_newlines', True)
  raise_on_failure = kwargs.pop('raise_on_failure', True)
  proc = subprocess.Popen(cmd, **kwargs)
  ret, err = proc.communicate()
  if proc.returncode != 0:
    if raise_on_failure:
      print('Error: %s' % err)
      raise subprocess.CalledProcessError(proc.returncode, cmd)
    return
  ret = (ret or '').rstrip('\n')
  return ret
def RunCommand ( * cmd , ** kwargs ) : kwargs . setdefault ( 'stdin' , subprocess . PIPE ) kwargs . setdefault ( 'stdout' , subprocess . PIPE ) kwargs . setdefault ( 'stderr' , subprocess . PIPE ) kwargs . setdefault ( 'universal_newlines' , True ) raise_on_failure = kwargs . pop ( 'raise_on_failure' , True ) proc = subprocess . Popen ( cmd , ** kwargs ) ret , err = proc . communicate ( ) if proc . returncode != 0 : if raise_on_failure : print ( 'Error: %s' % err ) raise subprocess . CalledProcessError ( proc . returncode , cmd ) return ret = ( ret or '' ) . rstrip ( '\n' ) return ret
Runs a command.
Runs a command .
"""Runs a command.

  Returns what have been printed to stdout by this command.

  kwargs:
    raise_on_failure: Indicates if an exception should be raised on failure, if
        set to false then the function will return None.
  """