Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Commit da5906c

Browse files
committed
feat:优化了代码✨
1 parent e941e9d commit da5906c

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

my_xxt/my_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ def get_not_work(courses: list, xxt: NewXxt, console: Console, sleep_time: float
439439
"course_name": work["course_name"]
440440
})
441441
except Exception as e:
442-
console.print("[red]出现了一点小意外")
442+
console.print(f"[red]在查找课程[green]《{course['course_name']}》[/green]出现了一点小意外")
443443
return not_work
444444

445445

my_xxt/question_type.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,19 @@ def programme(item: bs4.element.Tag):
104104

105105
@staticmethod
106106
def other(item: bs4.element.Tag):
107-
print("其他")
107+
title = item.find("h3", attrs={"class": "mark_name colorDeep fontLabel"}).text
108+
question_answer = {
109+
"id": item.attrs['data'],
110+
"title": my_replace(title),
111+
"type": "其他",
112+
"answer": None,
113+
"option": None
114+
}
115+
return question_answer
108116

109117
@staticmethod
110118
def error():
111-
print("出现了错误")
119+
print("该题型暂不支持")
112120

113121

114122
def my_replace(_string: str):

0 commit comments

Comments
 (0)