chrome/test/mini_installer/installer_test.py
def RunCommand(command, variable_expander):
    """Runs the given command from the current file's directory.

    This function throws an Exception if the command returns with non-zero exit
    status.

    Args:
        command: A command to run. It is expanded using Expand.
        variable_expander: A VariableExpander object.
    """
    expanded_command = variable_expander.Expand(command)
    script_dir = os.path.dirname(os.path.abspath(__file__))
    returncode = None
    stdout = ''
    stderr = ''
    # Uninstall is special in that it is run in interactive mode and may need
    # user input. This needs to happen even if the quiet arg is passed to
    # prevent a deadlock
    if 'uninstall_chrome.py' in expanded_command:
        returncode = subprocess.call(expanded_command,
                                     shell=True,
                                     cwd=script_dir)
    else:
        proc = subprocess.Popen(expanded_command,
                                shell=True,
                                cwd=script_dir,
                                stdout=subprocess.PIPE,
                                stderr=subprocess.PIPE)
        stdout, stderr = proc.communicate()
        returncode = proc.returncode

    if stdout:
        LOGGER.info('stdout:\n%s', stdout.replace('\r', '').rstrip('\n'))
    if stderr:
        LOGGER.error('stdout:\n%s', stderr.replace('\r', '').rstrip('\n'))
    if returncode != 0:
        raise Exception('Command %s returned non-zero exit status %s' %
                        (expanded_command, returncode))
Runs the given command from the current file's directory.

    This function throws an Exception if the command returns with non-zero exit
    status.

    Args:
        command: A command to run. It is expanded using Expand.
        variable_expander: A VariableExpander object.
    
Runs the given command from the current file's directory.
This function throws an Exception if the command returns with non-zero exit
status.
Runs the given command from the current file ' s directory . This function throws an Exception if the command returns with non - zero exit status .
def RunCommand(command, variable_expander):
    expanded_command = variable_expander.Expand(command)
    script_dir = os.path.dirname(os.path.abspath(__file__))
    returncode = None
    stdout = ''
    stderr = ''
    if 'uninstall_chrome.py' in expanded_command:
        returncode = subprocess.call(expanded_command,
                                     shell=True,
                                     cwd=script_dir)
    else:
        proc = subprocess.Popen(expanded_command,
                                shell=True,
                                cwd=script_dir,
                                stdout=subprocess.PIPE,
                                stderr=subprocess.PIPE)
        stdout, stderr = proc.communicate()
        returncode = proc.returncode
    if stdout:
        LOGGER.info('stdout:\n%s', stdout.replace('\r', '').rstrip('\n'))
    if stderr:
        LOGGER.error('stdout:\n%s', stderr.replace('\r', '').rstrip('\n'))
    if returncode != 0:
        raise Exception('Command %s returned non-zero exit status %s' %
                        (expanded_command, returncode))
def RunCommand ( command , variable_expander ) : expanded_command = variable_expander . Expand ( command ) script_dir = os . path . dirname ( os . path . abspath ( __file__ ) ) returncode = None stdout = '' stderr = '' if 'uninstall_chrome.py' in expanded_command : returncode = subprocess . call ( expanded_command , shell = True , cwd = script_dir ) else : proc = subprocess . Popen ( expanded_command , shell = True , cwd = script_dir , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) stdout , stderr = proc . communicate ( ) returncode = proc . returncode if stdout : LOGGER . info ( 'stdout:\n%s' , stdout . replace ( '\r' , '' ) . rstrip ( '\n' ) ) if stderr : LOGGER . error ( 'stdout:\n%s' , stderr . replace ( '\r' , '' ) . rstrip ( '\n' ) ) if returncode != 0 : raise Exception ( 'Command %s returned non-zero exit status %s' % ( expanded_command , returncode ) )
Runs the given command from the current file's directory.
Runs the given command from the current file ' s directory .
"""Runs the given command from the current file's directory.

    This function throws an Exception if the command returns with non-zero exit
    status.

    Args:
        command: A command to run. It is expanded using Expand.
        variable_expander: A VariableExpander object.
    """ # Uninstall is special in that it is run in interactive mode and may need # user input. This needs to happen even if the quiet arg is passed to # prevent a deadlock
command
A command to run. It is expanded using Expand.
A command to run . It is expanded using Expand .
variable_expander
A VariableExpander object.
A VariableExpander object .