mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2025-01-13 07:33:53 +08:00
.
This commit is contained in:
parent
5c081a37e9
commit
c336a822b4
3
.github/scripts/build_lunatranslator.py
vendored
3
.github/scripts/build_lunatranslator.py
vendored
@ -285,6 +285,9 @@ def downloadbass():
|
|||||||
)
|
)
|
||||||
subprocess.run(f"curl -LO https://www.un4seen.com/files/z/2/bass_aac24.zip")
|
subprocess.run(f"curl -LO https://www.un4seen.com/files/z/2/bass_aac24.zip")
|
||||||
subprocess.run(f"7z x bass_aac24.zip -oALL")
|
subprocess.run(f"7z x bass_aac24.zip -oALL")
|
||||||
|
for _dir, _, _fs in os.walk('ALL'):
|
||||||
|
for _f in _fs:
|
||||||
|
print(os.path.normpath(os.path.abspath(os.path.join(_dir, _f))))
|
||||||
shutil.move(
|
shutil.move(
|
||||||
"ALL/bass_aac.dll",
|
"ALL/bass_aac.dll",
|
||||||
f"{rootDir}/files/plugins/DLL32",
|
f"{rootDir}/files/plugins/DLL32",
|
||||||
|
@ -2078,17 +2078,13 @@ class mdict(cishubase):
|
|||||||
|
|
||||||
print_exc()
|
print_exc()
|
||||||
|
|
||||||
def init(self):
|
def checkpath(self):
|
||||||
try:
|
if self.config["paths"] == self.paths:
|
||||||
with open("userconfig/mdict_config.json", "r", encoding="utf8") as ff:
|
return
|
||||||
self.extraconf = json.loads(ff.read())
|
self.paths = self.config["paths"]
|
||||||
except:
|
|
||||||
self.extraconf = {}
|
|
||||||
paths = self.config["paths"]
|
|
||||||
|
|
||||||
self.builders = []
|
self.builders = []
|
||||||
self.dedump = set()
|
self.dedump = set()
|
||||||
for f in paths:
|
for f in self.paths:
|
||||||
if f.strip() == "":
|
if f.strip() == "":
|
||||||
continue
|
continue
|
||||||
if not os.path.exists(f):
|
if not os.path.exists(f):
|
||||||
@ -2103,6 +2099,14 @@ class mdict(cishubase):
|
|||||||
_f = os.path.join(_dir, _f)
|
_f = os.path.join(_dir, _f)
|
||||||
self.init_once_mdx(_f)
|
self.init_once_mdx(_f)
|
||||||
|
|
||||||
|
def init(self):
|
||||||
|
try:
|
||||||
|
with open("userconfig/mdict_config.json", "r", encoding="utf8") as ff:
|
||||||
|
self.extraconf = json.loads(ff.read())
|
||||||
|
except:
|
||||||
|
self.extraconf = {}
|
||||||
|
self.paths = None
|
||||||
|
self.checkpath()
|
||||||
try:
|
try:
|
||||||
with open(
|
with open(
|
||||||
gobject.getuserconfigdir("mdict_config.json"), "w", encoding="utf8"
|
gobject.getuserconfigdir("mdict_config.json"), "w", encoding="utf8"
|
||||||
@ -2333,14 +2337,6 @@ class mdict(cishubase):
|
|||||||
skip = True
|
skip = True
|
||||||
idx += 1
|
idx += 1
|
||||||
|
|
||||||
class shitrule(AtRule):
|
|
||||||
def __init__(self, __):
|
|
||||||
super().__init__(0, 0, " ", " ", [], [])
|
|
||||||
self.__ = __
|
|
||||||
|
|
||||||
def _serialize_to(self, _):
|
|
||||||
return _(self.__)
|
|
||||||
|
|
||||||
def parserules(rules):
|
def parserules(rules):
|
||||||
# print(stylesheet)
|
# print(stylesheet)
|
||||||
for i, rule in enumerate(rules.copy()):
|
for i, rule in enumerate(rules.copy()):
|
||||||
@ -2348,17 +2344,12 @@ class mdict(cishubase):
|
|||||||
if not rule.content:
|
if not rule.content:
|
||||||
# @charset "UTF-8";
|
# @charset "UTF-8";
|
||||||
continue
|
continue
|
||||||
internal = "".join([_.serialize() for _ in rule.content])
|
internal = parse_stylesheet(rule.content, True, True)
|
||||||
internal = parse_stylesheet(internal, True, True)
|
|
||||||
if len(internal) and isinstance(internal[0], ParseError):
|
if len(internal) and isinstance(internal[0], ParseError):
|
||||||
# @font-face
|
# @font-face
|
||||||
continue
|
continue
|
||||||
# @....{ .klas{} }
|
# @....{ .klas{} }
|
||||||
internal = parserules(internal)
|
rule.content = parserules(internal)
|
||||||
_ = []
|
|
||||||
rule.content = internal
|
|
||||||
rule._serialize_to(_.append)
|
|
||||||
rules[i] = shitrule("".join(_))
|
|
||||||
elif isinstance(rule, QualifiedRule):
|
elif isinstance(rule, QualifiedRule):
|
||||||
parseaqr(rules[i])
|
parseaqr(rules[i])
|
||||||
return rules
|
return rules
|
||||||
@ -2436,7 +2427,9 @@ class mdict(cishubase):
|
|||||||
# print(keys)
|
# print(keys)
|
||||||
for k in keys:
|
for k in keys:
|
||||||
__safe = []
|
__safe = []
|
||||||
for content in sorted(set(self.searchthread_internal(index, k, __safe))):
|
for content in sorted(
|
||||||
|
set(self.searchthread_internal(index, k, __safe))
|
||||||
|
):
|
||||||
results.append(self.parseashtml(content))
|
results.append(self.parseashtml(content))
|
||||||
except:
|
except:
|
||||||
|
|
||||||
@ -2605,6 +2598,7 @@ if (content.style.display === 'block') {
|
|||||||
return content
|
return content
|
||||||
|
|
||||||
def search(self, word):
|
def search(self, word):
|
||||||
|
self.checkpath()
|
||||||
allres = []
|
allres = []
|
||||||
audiob64vals = {}
|
audiob64vals = {}
|
||||||
hrefsrcvals = {}
|
hrefsrcvals = {}
|
||||||
|
@ -1335,7 +1335,8 @@
|
|||||||
"./files/plugins/DLL32/winsharedutils32.dll",
|
"./files/plugins/DLL32/winsharedutils32.dll",
|
||||||
"./files/plugins/DLL32/libmecab.dll",
|
"./files/plugins/DLL32/libmecab.dll",
|
||||||
"./files/plugins/DLL32/bass.dll",
|
"./files/plugins/DLL32/bass.dll",
|
||||||
"./files/plugins/DLL32/bass_spx.dll"
|
"./files/plugins/DLL32/bass_spx.dll",
|
||||||
|
"./files/plugins/DLL32/bass_aac.dll"
|
||||||
],
|
],
|
||||||
"shared": [
|
"shared": [
|
||||||
"./files/plugins/shareddllproxy32.exe",
|
"./files/plugins/shareddllproxy32.exe",
|
||||||
@ -1354,6 +1355,7 @@
|
|||||||
"./files/plugins/DLL64/libcurl-x64.dll",
|
"./files/plugins/DLL64/libcurl-x64.dll",
|
||||||
"./files/plugins/DLL64/bass.dll",
|
"./files/plugins/DLL64/bass.dll",
|
||||||
"./files/plugins/DLL64/bass_spx.dll",
|
"./files/plugins/DLL64/bass_spx.dll",
|
||||||
|
"./files/plugins/DLL64/bass_aac.dll",
|
||||||
"./files/plugins/DLL64/brotlicommon.dll",
|
"./files/plugins/DLL64/brotlicommon.dll",
|
||||||
"./files/plugins/DLL64/brotlidec.dll"
|
"./files/plugins/DLL64/brotlidec.dll"
|
||||||
],
|
],
|
||||||
@ -1365,6 +1367,7 @@
|
|||||||
"./files/plugins/DLL32/libcurl.dll",
|
"./files/plugins/DLL32/libcurl.dll",
|
||||||
"./files/plugins/DLL32/bass.dll",
|
"./files/plugins/DLL32/bass.dll",
|
||||||
"./files/plugins/DLL32/bass_spx.dll",
|
"./files/plugins/DLL32/bass_spx.dll",
|
||||||
|
"./files/plugins/DLL32/bass_aac.dll",
|
||||||
"./files/plugins/DLL32/brotlicommon.dll",
|
"./files/plugins/DLL32/brotlicommon.dll",
|
||||||
"./files/plugins/DLL32/brotlidec.dll"
|
"./files/plugins/DLL32/brotlidec.dll"
|
||||||
]
|
]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
PyQt5==5.15.10
|
PyQt5==5.15.10
|
||||||
PyQt5-Qt5==5.15.2
|
PyQt5-Qt5==5.15.2
|
||||||
webviewpy==1.4.0
|
webviewpy==1.4.0
|
||||||
tinycss2
|
tinycss2==1.4.0
|
@ -1,4 +1,4 @@
|
|||||||
PyQt6==6.7.0
|
PyQt6==6.7.0
|
||||||
PyQt6-Qt6==6.7.0
|
PyQt6-Qt6==6.7.0
|
||||||
webviewpy==1.4.0
|
webviewpy==1.4.0
|
||||||
tinycss2
|
tinycss2==1.4.0
|
Loading…
x
Reference in New Issue
Block a user