mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2025-01-01 10:04:12 +08:00
fix
This commit is contained in:
parent
2a8eee528f
commit
a2ff34e0fe
@ -9,7 +9,7 @@ from myutils.utils import parsekeystringtomodvkcode, unsupportkey
|
|||||||
from myutils.config import globalconfig, _TR, static_data, savehook_new_data
|
from myutils.config import globalconfig, _TR, static_data, savehook_new_data
|
||||||
from myutils.subproc import subproc_w
|
from myutils.subproc import subproc_w
|
||||||
from myutils.wrapper import threader, tryprint
|
from myutils.wrapper import threader, tryprint
|
||||||
from myutils.ocrutil import imageCut, ocr_run
|
from myutils.ocrutil import imageCut, ocr_run_2
|
||||||
from gui.rangeselect import rangeselct_function
|
from gui.rangeselect import rangeselct_function
|
||||||
from gui.usefulwidget import (
|
from gui.usefulwidget import (
|
||||||
closeashidewindow,
|
closeashidewindow,
|
||||||
@ -131,7 +131,7 @@ class AnkiWindow(QWidget):
|
|||||||
|
|
||||||
@threader
|
@threader
|
||||||
def asyncocr(self, img):
|
def asyncocr(self, img):
|
||||||
self.__ocrsettext.emit(ocr_run(img))
|
self.__ocrsettext.emit(ocr_run_2(img))
|
||||||
|
|
||||||
def crop(self):
|
def crop(self):
|
||||||
def ocroncefunction(rect):
|
def ocroncefunction(rect):
|
||||||
|
@ -129,3 +129,19 @@ def ocr_run(qimage: QImage):
|
|||||||
msg = "<msg_error_refresh>" + _TR(globalconfig["ocr"][use]["name"]) + " " + msg
|
msg = "<msg_error_refresh>" + _TR(globalconfig["ocr"][use]["name"]) + " " + msg
|
||||||
text = msg
|
text = msg
|
||||||
return text
|
return text
|
||||||
|
|
||||||
|
|
||||||
|
def ocr_run_2(qimage: QImage):
|
||||||
|
text = ocr_run(qimage)
|
||||||
|
|
||||||
|
msgs = [
|
||||||
|
"<notrans>",
|
||||||
|
"<msg_info_not_refresh>",
|
||||||
|
"<msg_info_refresh>",
|
||||||
|
"<msg_error_not_refresh>",
|
||||||
|
"<msg_error_refresh>",
|
||||||
|
]
|
||||||
|
for msg in msgs:
|
||||||
|
if text.startswith(msg):
|
||||||
|
return text[len(msg) :]
|
||||||
|
return text
|
||||||
|
Loading…
x
Reference in New Issue
Block a user