From: Benjamin Mako Hill <mako@atdot.cc>
Date: Sat, 28 Sep 2024 23:27:12 +0000 (-0700)
Subject: Merge branch 'COM481-2024Q4'
X-Git-Url: https://code.communitydata.science/coldcallbot-discord.git/commitdiff_plain/d6b74612e3a2f01112fa14c6c86bec9c20093ed3

Merge branch 'COM481-2024Q4'
---

d6b74612e3a2f01112fa14c6c86bec9c20093ed3
diff --cc coldcall.py
index cc5504b,2250fac..37b4eb5
--- a/coldcall.py
+++ b/coldcall.py
@@@ -17,15 -21,14 +21,15 @@@ class ColdCall()
          self.record_attendance = record_attendance
  
          # filenames
-         self.__fn_studentinfo = "data/student_information.tsv"
-         self.__fn_daily_calllist = f"data/call_list-{self.today}.tsv"
-         self.__fn_daily_attendance = f"data/attendance-{self.today}.tsv"
-         self.__preferred_name_field = preferred_name_field
+         self.__fn_studentinfo = config["student_info_file"]
+         self.__fn_daily_calllist = config["daily_calllist_file"].format(date=self.today)
+         self.__fn_daily_attendance = config["daily_attendance"].format(date=self.today)
  
-         if preferred_name_field != None:
-             self.preferred_names = self.__get_preferred_names()
+         self.unique_row = config["unique_name_rowname"]
 -        self.preferred_row = config["preferred_name_rowname"]
 -
 -        self.preferred_names = self.__get_preferred_names()
++        if "preferred_name_rowname" in config:
++            self.preferred_row = config["preferred_name_rowname"]
 +        else:
-             self.preferred_names = None
++            self.preferred_row = None
          
      def __load_prev_questions(self):
          previous_questions = defaultdict(int)
@@@ -91,11 -96,11 +97,11 @@@
  
          # open for appending the student
          with open(self.__fn_daily_calllist, "a") as f:
-             print("\t".join([selected_student, str(datetime.now()),
-                              "MISSING", "MISSING"]), file=f)
+             print("\t".join([selected_student, preferred_name,
+                              "MISSING", "MISSING", str(datetime.now())]), file=f)
  
      def coldcall(self, students_present):
 -        selected_student = self.__select_student_from_list(students_present)
 +        selected_student = self.select_student_from_list(students_present)
  
          # record the called-upon student in the right place
          if self.record_attendance: