@@ -0,0 +1,1730 @@
+import collections%0A%0Aimport prettytable%0Aimport yaml%0A%0Aimport library%0A%0A%22%22%22Generate governance repo voting record.%22%22%22%0A%0A%0Adef print_voting_record(change_ids, repo):%0A    headers = %5B%22Subject%22, %22Link%22%5D%0A    names = collections.defaultdict(dict)  # %7Bname: %7Bnumber:vote, %7D,%7D%0A    total_votes = collections.defaultdict(int)  # %7Bname: count%7D%0A    changes = dict()  # %7Bnumber: subject, %7D%0A%0A    for details in library.get_change_details(change_ids, repo):%0A        number = details%5B'_number'%5D%0A        changes%5Bnumber%5D = details%5B'subject'%5D%0A        for user in details%5B'labels'%5D%5B'Code-Review'%5D%5B'all'%5D:%0A            if user%5B'value'%5D in (1, -1) and user%5B'name'%5D != %22Jenkins%22:%0A                names%5Buser%5B'name'%5D%5D%5Bnumber%5D = user%5B'value'%5D%0A                total_votes%5Buser%5B'name'%5D%5D += 1%0A%0A    # build table%0A    x = prettytable.PrettyTable(headers + sorted(names),%0A                                hrules=prettytable.ALL)%0A    # total votes%0A    row = %5B%22total votes%22, %22N/A%22%5D%0A    for name in sorted(total_votes):%0A        row.append(total_votes%5Bname%5D)%0A    x.add_row(row)%0A    for number in changes:%0A        row = %5Bchanges%5Bnumber%5D,%0A               %22https://review.openstack.org/#/c/%25s/%22 %25 number%5D%0A        for name in sorted(names):%0A            if names%5Bname%5D.get(number) is not None:%0A                row.append(names%5Bname%5D%5Bnumber%5D)%0A            else:%0A                row.append(%22 %22)%0A        x.add_row(row)%0A%0A    print x.get_html_string(format=True)%0A%0A%0Adef main():%0A    config = yaml.load(open('config.yaml', 'r'))%0A    repo = %22openstack/governance%22%0A    path = config%5B'path'%5D + repo%0A%0A    change_ids = library.get_change_ids(path, since=%225.months%22)%0A    change_ids = change_ids%5B:config%5B'limit'%5D%5D%0A    print_voting_record(change_ids, repo)%0A%0A%0Aif __name__ == '__main__':%0A    main()%0A

Add script to generate voting record for governance repo