Skip to content

Commit 61ca6b4

Browse files
committed
fix: 修复字符串格式化中的引号使用问题
1 parent b58162e commit 61ca6b4

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/tchMaterial-parser.pyw

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ def parse(url: str, bookmarks: bool) -> tuple[str, str, list] | tuple[None, None
161161
mappings.sort(key=lambda x: x["page_number"])
162162
for i, m in enumerate(mappings):
163163
temp_chapters.append({
164-
"title": f"第 {i+1} 节 (P{m["page_number"]})",
165-
"page_index": m["page_number"]
164+
"title": f"第 {i+1} 节 (P{m['page_number']})",
165+
"page_index": m['page_number']
166166
})
167167
chapters = temp_chapters
168168

@@ -650,9 +650,9 @@ class resource_helper: # 获取网站上资源的数据
650650
if not temp_hier["children"]:
651651
temp_hier["children"] = {}
652652

653-
book["display_name"] = book["title"] if "title" in book else book["name"] if "name" in book else f"(未知电子课本 {book["id"]})"
653+
book["display_name"] = book["title"] if "title" in book else book["name"] if "name" in book else f"(未知电子课本 {book['id']})"
654654

655-
temp_hier["children"][book["id"]] = book
655+
temp_hier["children"][book['id']] = book
656656

657657
return parsed_hier
658658

@@ -683,9 +683,9 @@ class resource_helper: # 获取网站上资源的数据
683683
if not temp_hier["children"]:
684684
temp_hier["children"] = {}
685685

686-
lesson["display_name"] = lesson["title"] if "title" in lesson else lesson["name"] if "name" in lesson else f"(未知课件 {lesson["id"]})"
686+
lesson["display_name"] = lesson["title"] if "title" in lesson else lesson["name"] if "name" in lesson else f"(未知课件 {lesson['id']})"
687687

688-
temp_hier["children"][lesson["id"]] = lesson
688+
temp_hier["children"][lesson['id']] = lesson
689689

690690
return parsed_hier
691691

@@ -739,7 +739,7 @@ root = tk.Tk()
739739
ui_font_family = pick_ui_font_family()
740740

741741
# 高 DPI 适配
742-
if os_name == "Windows" and win32print and win32gui and win32con and win32api:
742+
if os_name == "Windows" and win32print and win32gui and win32con and win32api and ctypes:
743743
scale: float = round(win32print.GetDeviceCaps(win32gui.GetDC(0), win32con.DESKTOPHORZRES) / win32api.GetSystemMetrics(0), 2) # 获取当前的缩放因子
744744

745745
# 调用 API 设置成由应用程序缩放

0 commit comments

Comments
 (0)