feat: 改进缓存管理器

This commit is contained in:
2025-12-08 16:50:44 +08:00
parent 483670b23d
commit 42708e8a09
4 changed files with 112 additions and 79 deletions

View File

@@ -41,7 +41,7 @@ class MemScreen(Screen):
print(puzzle_info)
return shim.puzzle2widget[puzzle_info["puzzle"]](atom = self.procession.current_atom, alia = puzzle_info["alia"])
except (KeyError, StopIteration, AttributeError) as e:
print(f"Fission error: {e}")
print(f"调度展开出错: {e}")
return Static("无法生成谜题")
#print(shim.puzzle2widget[puzzle_info["puzzle"]])
@@ -50,7 +50,7 @@ class MemScreen(Screen):
with Center():
yield Static(f"当前进度: {self.procession.process()}/{self.procession.total_length()}")
self.mount(self.current_widget()) # type: ignore
#yield Button("重新学习此单元", id="re-recognize", variant="warning")
yield Button("重新学习此单元", id="re-recognize", variant="warning")
yield Footer()
def on_mount(self):
@@ -63,12 +63,6 @@ class MemScreen(Screen):
"""朗读当前内容"""
pass
def action_precache_current(self):
"""预缓存当前单元集的音频"""
#from .precache import PrecachingScreen
#precache_screen = PrecachingScreen(self.nucleon_file)
#self.app.push_screen(precache_screen)
def action_toggle_dark(self):
self.app.action_toggle_dark()