mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 00:24:13 +08:00
fix
This commit is contained in:
parent
2b22aed1d8
commit
22984f53ec
@ -2,6 +2,7 @@ from translator.basetranslator_dev import basetransdev
|
|||||||
import time, os
|
import time, os
|
||||||
from myutils.utils import createenglishlangmap
|
from myutils.utils import createenglishlangmap
|
||||||
|
|
||||||
|
|
||||||
class commonllmdev(basetransdev):
|
class commonllmdev(basetransdev):
|
||||||
jsfile = ...
|
jsfile = ...
|
||||||
textarea_selector = ...
|
textarea_selector = ...
|
||||||
@ -52,16 +53,22 @@ class commonllmdev(basetransdev):
|
|||||||
f"document.querySelector({repr(self.button_selector)}).click()"
|
f"document.querySelector({repr(self.button_selector)}).click()"
|
||||||
)
|
)
|
||||||
if self.config["usingstream"]:
|
if self.config["usingstream"]:
|
||||||
curr = ""
|
__ = [""]
|
||||||
while not self.Runtime_evaluate("hasdone")["result"]["value"]:
|
|
||||||
|
def ___(__):
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
thistext = self.Runtime_evaluate("thistext")["result"]["value"]
|
thistext = self.Runtime_evaluate("thistext")["result"]["value"]
|
||||||
if thistext.startswith(curr):
|
|
||||||
yield thistext[len(curr) :]
|
if thistext.startswith(__[0]):
|
||||||
|
yield thistext[len(__[0]) :]
|
||||||
else:
|
else:
|
||||||
yield '\0'
|
yield "\0"
|
||||||
yield thistext
|
yield thistext
|
||||||
curr = thistext
|
__[0] = thistext
|
||||||
|
|
||||||
|
while not self.Runtime_evaluate("hasdone")["result"]["value"]:
|
||||||
|
yield from ___(__)
|
||||||
|
yield from ___(__)
|
||||||
else:
|
else:
|
||||||
while not self.Runtime_evaluate("hasdone")["result"]["value"]:
|
while not self.Runtime_evaluate("hasdone")["result"]["value"]:
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user