mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 00:24:13 +08:00
fix
This commit is contained in:
parent
a001ba38c7
commit
eda4c303ba
@ -119,6 +119,7 @@ class AnkiWindow(QDialog):
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
media = []
|
media = []
|
||||||
|
tempfiles=[]
|
||||||
for k, _ in [("audio", self.audiofile), ("image", self.cropedimagepath)]:
|
for k, _ in [("audio", self.audiofile), ("image", self.cropedimagepath)]:
|
||||||
if _:
|
if _:
|
||||||
media.append(
|
media.append(
|
||||||
@ -130,6 +131,7 @@ class AnkiWindow(QDialog):
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
tempfiles.append(_)
|
||||||
else:
|
else:
|
||||||
media.append([])
|
media.append([])
|
||||||
|
|
||||||
@ -145,7 +147,11 @@ class AnkiWindow(QDialog):
|
|||||||
media[0],
|
media[0],
|
||||||
media[1],
|
media[1],
|
||||||
)
|
)
|
||||||
|
for _ in tempfiles:
|
||||||
|
try:
|
||||||
|
os.remove(_)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
class searchwordW(closeashidewindow):
|
class searchwordW(closeashidewindow):
|
||||||
getnewsentencesignal = pyqtSignal(str, bool)
|
getnewsentencesignal = pyqtSignal(str, bool)
|
||||||
|
@ -15,6 +15,7 @@ model_htmlfront = """
|
|||||||
{{explain}}
|
{{explain}}
|
||||||
<br>
|
<br>
|
||||||
{{image}}
|
{{image}}
|
||||||
|
<div class='icon_audio'>{{audio}}</div>
|
||||||
"""
|
"""
|
||||||
model_htmlback = """
|
model_htmlback = """
|
||||||
{{word}}
|
{{word}}
|
||||||
@ -22,4 +23,5 @@ model_htmlback = """
|
|||||||
{{explain}}
|
{{explain}}
|
||||||
<br>
|
<br>
|
||||||
{{image}}
|
{{image}}
|
||||||
|
<div class='icon_audio'>{{audio}}</div>
|
||||||
"""
|
"""
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
from myutils.config import globalconfig
|
from myutils.config import globalconfig
|
||||||
import threading
|
import threading, os
|
||||||
|
|
||||||
|
|
||||||
class TTSbase:
|
class TTSbase:
|
||||||
@ -71,4 +71,4 @@ class TTSbase:
|
|||||||
voice = globalconfig["reader"][self.typename]["voice"]
|
voice = globalconfig["reader"][self.typename]["voice"]
|
||||||
voice_index = self.voicelist.index(voice)
|
voice_index = self.voicelist.index(voice)
|
||||||
fname = self.speak(content, rate, voice, voice_index)
|
fname = self.speak(content, rate, voice, voice_index)
|
||||||
return fname
|
return os.path.abspath(fname)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user