Skip to content

Commit f60d7ff

Browse files
committed
Update vote tally script
1 parent f30e220 commit f60d7ff

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

utils/tally_votes.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,27 @@ def confirm_id(id, name, org, attendance_list):
1515
name == entry['name'] and
1616
org == entry['org']):
1717
return 1;
18+
else:
19+
print("Expected ID for " + name + ", " + org + ": " + entry['uuid'])
20+
print("Got ID: " + id)
21+
print("Got name: " + entry['name'])
22+
print("Got org: " + entry['org'])
1823
return 0;
1924

2025
def delete_from_list(org, ooe_list):
2126
for entry in iter(ooe_list):
2227
if (org == entry['org_name']):
2328
ooe_list.remove(entry)
2429

30+
def check_empty(val):
31+
return val == None or val == "" or val == 0
32+
2533
def main():
2634
attendance_file=sys.argv[1]; # File with UUIDs for each attendee
2735
ballot_file=sys.argv[2]; # File with list of ballots on which to be voted
2836
votes_file=sys.argv[3]; # File with votes captured from Google Forms
29-
prev_votes_file="../_data/meetings/2025/03/votes.csv"
30-
prev_ballots_file="../_data/meetings/2025/03/ballot.csv"
37+
prev_votes_file="../_data/meetings/2025/06/votes.csv"
38+
prev_ballots_file="../_data/meetings/2025/06/ballot.csv"
3139
if not os.path.isfile(prev_votes_file):
3240
prev_votes_file=""
3341
if not os.path.isfile(prev_ballots_file):
@@ -58,10 +66,8 @@ def main():
5866
topic = ballot['topic'] + " (" + ballot['type'] + ")"
5967

6068
if (ballot['topic'] == "daybreak" or
61-
((ballot['yes'] == None or int(ballot['yes']) == 0) and
62-
(ballot['no'] == None or int(ballot['no']) == 0) and
63-
(ballot['abstain'] == None or int(ballot['abstain']) == 0) and
64-
(ballot['missed'] == None or int(ballot['missed']) == 0))):
69+
(check_empty(ballot['yes']) and check_empty(ballot['no']) and
70+
check_empty(ballot['abstain']) and check_empty(ballot['missed']))):
6571
continue;
6672
ballot_dict[topic] = ballot;
6773
previous_topics.append(topic);

0 commit comments

Comments
 (0)