style: 格式化代码

This commit is contained in:
2025-12-21 07:56:10 +08:00
parent 531b0756bf
commit 8dd323a789
15 changed files with 373 additions and 290 deletions

View File

@@ -148,16 +148,24 @@ class MemScreen(Screen):
def play_voice(self):
"""朗读当前内容"""
from heurams.services.audio_service import play_by_path
from pathlib import Path
from heurams.services.audio_service import play_by_path
from heurams.services.hasher import get_md5
path = Path(config_var.get()['paths']["cache_dir"])
path = path / f"{get_md5(self.atom.registry['nucleon'].metadata["formation"]["tts_text"])}.wav"
path = Path(config_var.get()["paths"]["cache_dir"])
path = (
path
/ f"{get_md5(self.atom.registry['nucleon'].metadata["formation"]["tts_text"])}.wav"
)
if path.exists():
play_by_path(path)
else:
from heurams.services.tts_service import convertor
convertor(self.atom.registry['nucleon'].metadata["formation"]["tts_text"], path)
convertor(
self.atom.registry["nucleon"].metadata["formation"]["tts_text"], path
)
play_by_path(path)
def action_toggle_dark(self):