add
This commit is contained in:
@@ -98,7 +98,6 @@ info_file_path = "info.txt"
|
|||||||
grade_file_path = "grade.txt"
|
grade_file_path = "grade.txt"
|
||||||
old_grade_file_path = "old_grade.txt"
|
old_grade_file_path = "old_grade.txt"
|
||||||
|
|
||||||
|
|
||||||
# 初始化运行次数
|
# 初始化运行次数
|
||||||
run_count = 2
|
run_count = 2
|
||||||
|
|
||||||
@@ -116,11 +115,6 @@ else:
|
|||||||
# 非第一次运行程序
|
# 非第一次运行程序
|
||||||
run_count = 1
|
run_count = 1
|
||||||
|
|
||||||
|
|
||||||
# 获取已选课程信息
|
|
||||||
selected_courses_data = student_client.get_selected_courses().get("data", {})
|
|
||||||
selected_courses = selected_courses_data.get("courses", [])
|
|
||||||
|
|
||||||
# 第一次运行程序则运行两遍,否则运行一遍
|
# 第一次运行程序则运行两遍,否则运行一遍
|
||||||
for _ in range(run_count):
|
for _ in range(run_count):
|
||||||
# 如果grade.txt文件不存在,则创建文件
|
# 如果grade.txt文件不存在,则创建文件
|
||||||
@@ -203,7 +197,6 @@ for _ in range(run_count):
|
|||||||
with open(grade_file_path, "w") as grade_file:
|
with open(grade_file_path, "w") as grade_file:
|
||||||
grade_file.write(encrypted_integrated_grade_info)
|
grade_file.write(encrypted_integrated_grade_info)
|
||||||
|
|
||||||
|
|
||||||
# 成绩信息不为空时整合GPA信息
|
# 成绩信息不为空时整合GPA信息
|
||||||
if grade:
|
if grade:
|
||||||
# 整合个人信息
|
# 整合个人信息
|
||||||
@@ -227,6 +220,10 @@ first_run_text = (
|
|||||||
# 整合MD5值
|
# 整合MD5值
|
||||||
integrated_grade_info += f"\n" f"MD5:{encrypted_integrated_grade_info}"
|
integrated_grade_info += f"\n" f"MD5:{encrypted_integrated_grade_info}"
|
||||||
|
|
||||||
|
# 获取已选课程信息
|
||||||
|
selected_courses_data = student_client.get_selected_courses().get("data", {})
|
||||||
|
selected_courses = selected_courses_data.get("courses", [])
|
||||||
|
|
||||||
# 已选课程信息不为空时,处理未公布成绩的课程和异常课程
|
# 已选课程信息不为空时,处理未公布成绩的课程和异常课程
|
||||||
if selected_courses:
|
if selected_courses:
|
||||||
# 初始化空字典用于存储未公布成绩的课程,按学年学期分组
|
# 初始化空字典用于存储未公布成绩的课程,按学年学期分组
|
||||||
@@ -324,7 +321,6 @@ grades_updated_push_integrated_send_info = (
|
|||||||
f"{integrated_send_info}"
|
f"{integrated_send_info}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
# 如果是第一次运行,则提示程序运行成功
|
# 如果是第一次运行,则提示程序运行成功
|
||||||
if run_count == 2:
|
if run_count == 2:
|
||||||
run_log += f"{first_run_text}\n"
|
run_log += f"{first_run_text}\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user