chrome/test/mini_installer/installer_test.py
def RunCleanCommand(force_clean, clean_state, variable_expander):
    """Puts the machine in the clean state (e.g. Chrome not installed).

    Args:
        force_clean: A boolean indicating whether to force cleaning existing
            installations.
        clean_state: The state used to verify a clean machine after each test.
            This state is used to drive the cleanup operation.
        variable_expander: A VariableExpander object.
    """
    # A list of (product_name, product_switch) tuples for the possible installed
    # products.
    data = [
        ('$CHROME_LONG_NAME', ''),
        ('$CHROME_LONG_NAME', '--system-level'),
    ]
    if variable_expander.Expand('$BRAND') == 'Google Chrome':
        data.extend([('$CHROME_LONG_NAME_BETA', ''),
                     ('$CHROME_LONG_NAME_BETA', '--system-level'),
                     ('$CHROME_LONG_NAME_DEV', ''),
                     ('$CHROME_LONG_NAME_DEV', '--system-level'),
                     ('$CHROME_LONG_NAME_SXS', '')])

    # Attempt to run each installed product's uninstaller.
    interactive_option = '--interactive' if not force_clean else ''
    for product_name, product_switch in data:
        command = ('python uninstall_chrome.py '
                   '--chrome-long-name="%s" '
                   '--no-error-if-absent %s %s' %
                   (product_name, product_switch, interactive_option))
        try:
            RunCommand(command, variable_expander)
        except:  # pylint: disable=bare-except
            message = traceback.format_exception(*sys.exc_info())
            message.insert(0, 'Error cleaning up an old install with:\n')
            LOGGER.info(''.join(message))
            if not force_clean:
                raise

    # Once everything is uninstalled, make a pass to delete any stray tidbits on
    # the machine.
    if force_clean:
        property_walker.Clean(clean_state, variable_expander)
Puts the machine in the clean state (e.g. Chrome not installed).

    Args:
        force_clean: A boolean indicating whether to force cleaning existing
            installations.
        clean_state: The state used to verify a clean machine after each test.
            This state is used to drive the cleanup operation.
        variable_expander: A VariableExpander object.
    
Puts the machine in the clean state .
Puts the machine in the clean state .
def RunCleanCommand(force_clean, clean_state, variable_expander):
    data = [
        ('$CHROME_LONG_NAME', ''),
        ('$CHROME_LONG_NAME', '--system-level'),
    ]
    if variable_expander.Expand('$BRAND') == 'Google Chrome':
        data.extend([('$CHROME_LONG_NAME_BETA', ''),
                     ('$CHROME_LONG_NAME_BETA', '--system-level'),
                     ('$CHROME_LONG_NAME_DEV', ''),
                     ('$CHROME_LONG_NAME_DEV', '--system-level'),
                     ('$CHROME_LONG_NAME_SXS', '')])
    interactive_option = '--interactive' if not force_clean else ''
    for product_name, product_switch in data:
        command = ('python uninstall_chrome.py '
                   '--chrome-long-name="%s" '
                   '--no-error-if-absent %s %s' %
                   (product_name, product_switch, interactive_option))
        try:
            RunCommand(command, variable_expander)
        except:  
            message = traceback.format_exception(*sys.exc_info())
            message.insert(0, 'Error cleaning up an old install with:\n')
            LOGGER.info(''.join(message))
            if not force_clean:
                raise
    if force_clean:
        property_walker.Clean(clean_state, variable_expander)
def RunCleanCommand ( force_clean , clean_state , variable_expander ) : data = [ ( '$CHROME_LONG_NAME' , '' ) , ( '$CHROME_LONG_NAME' , '--system-level' ) , ] if variable_expander . Expand ( '$BRAND' ) == 'Google Chrome' : data . extend ( [ ( '$CHROME_LONG_NAME_BETA' , '' ) , ( '$CHROME_LONG_NAME_BETA' , '--system-level' ) , ( '$CHROME_LONG_NAME_DEV' , '' ) , ( '$CHROME_LONG_NAME_DEV' , '--system-level' ) , ( '$CHROME_LONG_NAME_SXS' , '' ) ] ) interactive_option = '--interactive' if not force_clean else '' for product_name , product_switch in data : command = ( 'python uninstall_chrome.py ' '--chrome-long-name="%s" ' '--no-error-if-absent %s %s' % ( product_name , product_switch , interactive_option ) ) try : RunCommand ( command , variable_expander ) except : message = traceback . format_exception ( * sys . exc_info ( ) ) message . insert ( 0 , 'Error cleaning up an old install with:\n' ) LOGGER . info ( '' . join ( message ) ) if not force_clean : raise if force_clean : property_walker . Clean ( clean_state , variable_expander )
Puts the machine in the clean state (e.g.
Puts the machine in the clean state ( e . g .
"""Puts the machine in the clean state (e.g. Chrome not installed).

    Args:
        force_clean: A boolean indicating whether to force cleaning existing
            installations.
        clean_state: The state used to verify a clean machine after each test.
            This state is used to drive the cleanup operation.
        variable_expander: A VariableExpander object.
    """ # A list of (product_name, product_switch) tuples for the possible installed # products. # Attempt to run each installed product's uninstaller. # pylint: disable=bare-except # Once everything is uninstalled, make a pass to delete any stray tidbits on # the machine.
force_clean
A boolean indicating whether to force cleaning existing
installations.
A boolean indicating whether to force cleaning existing installations .
clean_state
The state used to verify a clean machine after each test.
This state is used to drive the cleanup operation.
The state used to verify a clean machine after each test . This state is used to drive the cleanup operation .
variable_expander
A VariableExpander object.
A VariableExpander object .