mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-26 23:24:13 +08:00
.
This commit is contained in:
parent
7aa97c92e7
commit
5c081a37e9
10
.github/scripts/build_lunatranslator.py
vendored
10
.github/scripts/build_lunatranslator.py
vendored
@ -283,6 +283,16 @@ def downloadbass():
|
||||
"ALL/x64/bass_spx.dll",
|
||||
f"{rootDir}/files/plugins/DLL64",
|
||||
)
|
||||
subprocess.run(f"curl -LO https://www.un4seen.com/files/z/2/bass_aac24.zip")
|
||||
subprocess.run(f"7z x bass_aac24.zip -oALL")
|
||||
shutil.move(
|
||||
"ALL/bass_aac.dll",
|
||||
f"{rootDir}/files/plugins/DLL32",
|
||||
)
|
||||
shutil.move(
|
||||
"ALL/x64/bass_aac.dll",
|
||||
f"{rootDir}/files/plugins/DLL64",
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
set(VERSION_MAJOR 6)
|
||||
set(VERSION_MINOR 14)
|
||||
set(VERSION_PATCH 11)
|
||||
set(VERSION_PATCH 12)
|
||||
set(VERSION_REVISION 0)
|
||||
set(LUNA_VERSION "{${VERSION_MAJOR},${VERSION_MINOR},${VERSION_PATCH},${VERSION_REVISION}}")
|
||||
add_library(VERSION_DEF ${CMAKE_CURRENT_LIST_DIR}/version_def.cpp)
|
||||
|
@ -2125,7 +2125,7 @@ class mdict(cishubase):
|
||||
if dis <= distance:
|
||||
results.append(k)
|
||||
diss[k] = dis
|
||||
return sorted(results, key=lambda x: (diss[x], x))[: self.config["max_num"]]
|
||||
return sorted(results, key=lambda x: diss[x])[: self.config["max_num"]]
|
||||
|
||||
def parse_strings(self, input_string):
|
||||
parsed_strings = []
|
||||
@ -2291,26 +2291,13 @@ class mdict(cishubase):
|
||||
try:
|
||||
from tinycss2 import parse_stylesheet, serialize
|
||||
from tinycss2.ast import (
|
||||
HashToken,
|
||||
WhitespaceToken,
|
||||
AtRule,
|
||||
QualifiedRule,
|
||||
IdentToken,
|
||||
ParseError,
|
||||
Node,
|
||||
LiteralToken,
|
||||
)
|
||||
|
||||
class KlassToken(Node):
|
||||
type = "ident"
|
||||
|
||||
def __init__(self, line, column, value):
|
||||
Node.__init__(self, line, column)
|
||||
self.value = value
|
||||
|
||||
def _serialize_to(self, write):
|
||||
write(".")
|
||||
write(self.value)
|
||||
|
||||
rules = parse_stylesheet(file_content, True, True)
|
||||
|
||||
def parseaqr(rule: QualifiedRule):
|
||||
@ -2325,7 +2312,9 @@ class mdict(cishubase):
|
||||
if start:
|
||||
if token.type == "ident" and token.value == "body":
|
||||
# body
|
||||
rule.prelude.insert(idx + 1, KlassToken(0, 0, divid))
|
||||
rule.prelude.insert(
|
||||
idx + 1, LiteralToken(0, 0, "." + divid)
|
||||
)
|
||||
rule.prelude.insert(idx + 1, WhitespaceToken(0, 0, " "))
|
||||
idx += 2
|
||||
else:
|
||||
@ -2333,7 +2322,9 @@ class mdict(cishubase):
|
||||
# tag
|
||||
# #class tag
|
||||
rule.prelude.insert(idx, WhitespaceToken(0, 0, " "))
|
||||
rule.prelude.insert(idx, KlassToken(0, 0, divid))
|
||||
rule.prelude.insert(
|
||||
idx, LiteralToken(0, 0, "." + divid + " ")
|
||||
)
|
||||
idx += 2
|
||||
start = False
|
||||
elif token.type == "literal" and token.value == ",":
|
||||
@ -2364,14 +2355,10 @@ class mdict(cishubase):
|
||||
continue
|
||||
# @....{ .klas{} }
|
||||
internal = parserules(internal)
|
||||
ser = "@"
|
||||
ser += rule.at_keyword
|
||||
ser += "{"
|
||||
for _ in internal:
|
||||
ser += _.serialize()
|
||||
ser += "}"
|
||||
# rule.serialize=functools.partial(__,ser)
|
||||
rules[i] = shitrule(ser)
|
||||
_ = []
|
||||
rule.content = internal
|
||||
rule._serialize_to(_.append)
|
||||
rules[i] = shitrule("".join(_))
|
||||
elif isinstance(rule, QualifiedRule):
|
||||
parseaqr(rules[i])
|
||||
return rules
|
||||
@ -2449,7 +2436,7 @@ class mdict(cishubase):
|
||||
# print(keys)
|
||||
for k in keys:
|
||||
__safe = []
|
||||
for content in set(self.searchthread_internal(index, k, __safe)):
|
||||
for content in sorted(set(self.searchthread_internal(index, k, __safe))):
|
||||
results.append(self.parseashtml(content))
|
||||
except:
|
||||
|
||||
|
@ -141,7 +141,7 @@ class playonce:
|
||||
|
||||
BASS_Init(-1, 44100, 0, 0, 0)
|
||||
# https://www.un4seen.com/
|
||||
plugins = {".spx": "bass_spx.dll"}
|
||||
plugins = {".spx": "bass_spx.dll", ".aac": "bass_aac.dll"}
|
||||
|
||||
pluginshandle = {}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user