]> code.communitydata.science - coldcallbot-discord.git/commitdiff
print preferred pronouns in the call list
authorBenjamin Mako Hill <mako@atdot.cc>
Sun, 29 Sep 2024 03:10:44 +0000 (20:10 -0700)
committerBenjamin Mako Hill <mako@atdot.cc>
Sun, 29 Sep 2024 03:11:54 +0000 (20:11 -0700)
coldcallbot-manual.py

index 75a88dcabef3ec30b5a08c0ea7ad228d1bfdd351..ac46bc1f5a9db4576575cc5e533ab15b705abaad 100755 (executable)
@@ -28,6 +28,13 @@ with open(config["roster_file"], 'r') as f:
         full_names[student_no] = f"{row[config['roster_firstname_rowname']]} {row[config['roster_lastname_rowname']]}"
 # print("Registered:", registered_students) # useful for debug
 
+# get pronouns
+with open(config["student_info_file"], 'r') as f:
+    preferred_pronouns = {}
+    for row in DictReader(f, delimiter="\t"):
+        preferred_pronouns[row[config["unique_name_rowname"]]] = row["Preferred pronouns"]
+print(preferred_pronouns)
+
 missing_today = [x for x in get_missing(current_time)]
 # print("Missing Today: ", missing_today)  # useful for debug
 
@@ -43,11 +50,14 @@ for i in range(100):
     try:
         preferred_name = preferred_names[selected_student]
     except KeyError:
-        preferred_name = "MISSING PREFERRED NAME"
+        preferred_name = "[unknown preferred name]"
+
+    if selected_student in preferred_pronouns:
+        pronouns = preferred_pronouns[selected_student]
+    else:
+        pronouns = "[unknown pronouns]"
+    
+    print(f"{i + 1}. {preferred_name} :: {pronouns} :: {full_names[selected_student]} :: {selected_student}")
 
-    print(f"{i + 1}.",
-          preferred_name, "::",
-          selected_student, "::",
-          full_names[selected_student])
     cc.record_coldcall(selected_student)
 

Community Data Science Collective || Want to submit a patch?