From 70ff3f8e7f57d49a5a9a91ed3b3068598030aab3 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: Wed, 14 Aug 2024 16:22:02 +0800 Subject: [PATCH] Update ocrutil.py --- LunaTranslator/LunaTranslator/myutils/ocrutil.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LunaTranslator/LunaTranslator/myutils/ocrutil.py b/LunaTranslator/LunaTranslator/myutils/ocrutil.py index f0f42429..cd874e09 100644 --- a/LunaTranslator/LunaTranslator/myutils/ocrutil.py +++ b/LunaTranslator/LunaTranslator/myutils/ocrutil.py @@ -108,11 +108,11 @@ def __ocr_init(): ): use = k break + _nowuseocrx = use if use is None: raise Exception("no engine") if _nowuseocr == use: return - _nowuseocrx = use _ocrengine = None _nowuseocr = None aclass = importlib.import_module("ocrengines." + use).OCR @@ -136,7 +136,7 @@ def ocr_run(qimage: QImage): msg = stringfyerror(e) msg = ( "" - + _TR(globalconfig["ocr"][_nowuseocrx]["name"]) + + (_TR(globalconfig["ocr"][_nowuseocrx]["name"]) if _nowuseocrx else "") + " " + msg )