mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 16:44:13 +08:00
Update ocrutil.py
This commit is contained in:
parent
b3d0294398
commit
70ff3f8e7f
@ -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
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user