Update ocrutil.py

This commit is contained in:
恍兮惚兮 2024-08-14 16:22:02 +08:00
parent b3d0294398
commit 70ff3f8e7f

View File

@ -108,11 +108,11 @@ def __ocr_init():
): ):
use = k use = k
break break
_nowuseocrx = use
if use is None: if use is None:
raise Exception("no engine") raise Exception("no engine")
if _nowuseocr == use: if _nowuseocr == use:
return return
_nowuseocrx = use
_ocrengine = None _ocrengine = None
_nowuseocr = None _nowuseocr = None
aclass = importlib.import_module("ocrengines." + use).OCR aclass = importlib.import_module("ocrengines." + use).OCR
@ -136,7 +136,7 @@ def ocr_run(qimage: QImage):
msg = stringfyerror(e) msg = stringfyerror(e)
msg = ( msg = (
"<msg_error_refresh>" "<msg_error_refresh>"
+ _TR(globalconfig["ocr"][_nowuseocrx]["name"]) + (_TR(globalconfig["ocr"][_nowuseocrx]["name"]) if _nowuseocrx else "")
+ " " + " "
+ msg + msg
) )