components/breadcrumbs/core/generate_not_user_triggered_actions.py
def main(actions_file_path, output_file_path):
    """Produces C++ file with sorted array of UMA User Actions strings.

    Array is a global kNotUserTriggeredActions constant in anonymous namespace.

    Args:
        actions_file_path: path to actions.xml file
        output_file_path: path to output C++ file
    """
    actions = not_user_triggered_actions(actions_file_path)
    if not actions:
        sys.stderr.write(
            'There are no not-user triggered and non-obsolete in %s',
            actions_file_path)
        return -1


    with open(output_file_path ,'w') as output_file:
        output_file.write('// Generated by %s\n' % sys.argv[0])
        output_file.write('namespace {\n')
        output_file.write('const char* const kNotUserTriggeredActions[] = {\n')

        for action in sorted(actions):
            output_file.write('  "%s",\n' % action)

        output_file.write('};\n')
        output_file.write('}  // namespace\n')
Produces C++ file with sorted array of UMA User Actions strings.

    Array is a global kNotUserTriggeredActions constant in anonymous namespace.

    Args:
        actions_file_path: path to actions.xml file
        output_file_path: path to output C++ file
    
Produces C++ file with sorted array of UMA User Actions strings.
Array is a global kNotUserTriggeredActions constant in anonymous namespace.
Produces C ++ file with sorted array of UMA User Actions strings . Array is a global kNotUserTriggeredActions constant in anonymous namespace .
def main(actions_file_path, output_file_path):
    actions = not_user_triggered_actions(actions_file_path)
    if not actions:
        sys.stderr.write(
            'There are no not-user triggered and non-obsolete in %s',
            actions_file_path)
        return -1
    with open(output_file_path ,'w') as output_file:
        output_file.write('// Generated by %s\n' % sys.argv[0])
        output_file.write('namespace {\n')
        output_file.write('const char* const kNotUserTriggeredActions[] = {\n')
        for action in sorted(actions):
            output_file.write('  "%s",\n' % action)
        output_file.write('};\n')
        output_file.write('}  // namespace\n')
def main ( actions_file_path , output_file_path ) : actions = not_user_triggered_actions ( actions_file_path ) if not actions : sys . stderr . write ( 'There are no not-user triggered and non-obsolete in %s' , actions_file_path ) return - 1 with open ( output_file_path , 'w' ) as output_file : output_file . write ( '// Generated by %s\n' % sys . argv [ 0 ] ) output_file . write ( 'namespace {\n' ) output_file . write ( 'const char* const kNotUserTriggeredActions[] = {\n' ) for action in sorted ( actions ) : output_file . write ( '  "%s",\n' % action ) output_file . write ( '};\n' ) output_file . write ( '}  // namespace\n' )
Produces C++ file with sorted array of UMA User Actions strings.
Produces C ++ file with sorted array of UMA User Actions strings .
"""Produces C++ file with sorted array of UMA User Actions strings.

    Array is a global kNotUserTriggeredActions constant in anonymous namespace.

    Args:
        actions_file_path: path to actions.xml file
        output_file_path: path to output C++ file
    """
actions_file_path
path to actions.xml file
path to actions . xml file
output_file_path
path to output C++ file
path to output C ++ file