def _get_students(self, path): """ Student detail are read using file reading gen and added to dictionary """ for cwid, name, major in file_reader(path, 3, sep='\t', header=True): if major not in self._majors: print(f"Student {cwid} '{name}' has unknown major '{major}'") else: self._students[cwid] = Student(cwid, name, self._majors[major])
def student_details(self, path: str) -> None: """ Student detail are put in dictionary with file reader """ for cwid, name, major in file_reader(path, 3, sep=';', header=True): if major not in self.major: print(f"Student {cwid} '{name}' has unknown major '{major}'") else: self.student[cwid] = Student(cwid, name, self.major[major])
def _get_grades(self, path): """Grades are read using file reading gen and assigned to student and instructor """ for std_cwid, course, grade, instructor_cwid in file_reader( path, 4, sep='\t', header=True): if std_cwid in self._students: self._students[std_cwid].add_course(course, grade) else: print(f'Grades for student is {std_cwid}') if instructor_cwid in self._instructors: self._instructors[instructor_cwid].add_student(course) else: print(f'Grades for instructor is {instructor_cwid}')
def grade_details(self, path): """Grades are put in dictionary with file reader """ for std_cwid, course, grade, instructor_cwid in file_reader( path, 4, sep='|', header=True): if std_cwid in self.student: self.student[std_cwid].add_course(course, grade) else: print(f'Student Grade is {std_cwid}') if instructor_cwid in self.instructor: self.instructor[instructor_cwid].add_student(course) else: print(f'Instructor Grade is {instructor_cwid}')
def grade_details(self, path: str) -> None: """Grades are added using file reader """ for std_cwid, course, grade, instructor_cwid in file_reader( path, 4, sep='|', header=False): if std_cwid in self.student: self.student[std_cwid].add_course(course, grade) else: print(f'Student grade is {std_cwid}') if instructor_cwid in self.instructor: self.instructor[instructor_cwid].add_student(course) else: print(f'Instructor grade is {instructor_cwid}')
def _get_instructors(self, path): """ Instructor detail are read using file reading gen and added to dictionary """ for cwid, name, dept in file_reader(path, 3, sep='\t', header=True): self._instructors[cwid] = Instructor(cwid, name, dept)
def _get_majors(self, path): """Major details are read using file reading gen and added to dictionary""" for major, flag, course in file_reader(path, 3, sep='\t', header=True): if major not in self._majors: self._majors[major] = Major(major) self._majors[major].add_course(course, flag)
def instructor_details(self, path): """ Instructor detail are put in dictionary with file reader """ for cwid, name, dept in file_reader(path, 3, sep='|', header=True): self.instructor[cwid] = Instructor(cwid, name, dept)
def major_details(self, path: str) -> None: """Major detail are put in dictionary with file reader""" for major, flag, course in file_reader(path, 3, sep='\t', header=True): if major not in self.major: self.major[major] = Major(major) self.major[major].add_course(course, flag)
def student_details(self, path: str) -> None: """ Student detail are put in dictionary with file reader """ for cwid, name, major in file_reader(path, 3, sep=';', header=False): self.student[cwid] = Student(cwid, name, major)