From b714917862531772d14c435de8014eaad6fa739d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Sun, 20 Oct 2024 19:07:29 +0800 Subject: [PATCH] ... --- src/LunaTranslator/LunaTranslator.py | 2 +- src/LunaTranslator/textsource/textsourcebase.py | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/LunaTranslator/LunaTranslator.py b/src/LunaTranslator/LunaTranslator.py index 3df85c05..bf743bb3 100644 --- a/src/LunaTranslator/LunaTranslator.py +++ b/src/LunaTranslator/LunaTranslator.py @@ -307,12 +307,12 @@ class MAINUI: return if is_auto_run and text == self.currenttext: return + origin = text currentsignature = uuid.uuid4() if not waitforresultcallback: self.currentsignature = currentsignature # 内嵌&文件翻译不要进行文本预处理 try: - origin = text text = POSTSOLVE(text) self.settin_ui.showandsolvesig.emit(origin, text) if not text: diff --git a/src/LunaTranslator/textsource/textsourcebase.py b/src/LunaTranslator/textsource/textsourcebase.py index 7355c1bf..6f2df98a 100644 --- a/src/LunaTranslator/textsource/textsourcebase.py +++ b/src/LunaTranslator/textsource/textsourcebase.py @@ -118,10 +118,7 @@ class basetext: "SELECT machineTrans FROM artificialtrans WHERE source = ?", (src,), ).fetchone() - try: - ret = json.loads((ret[0])) - except: - ret = {} + ret = json.loads((ret[0])) ret[clsname] = trans ret = json.dumps(ret, ensure_ascii=False) self.sqlwrite2.execute(