From 08f6fe7144916c8040c337fd9d987298192d0ec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <1173718158@qq.com> Date: Sun, 17 Nov 2024 03:03:26 +0800 Subject: [PATCH] xp --- .github/scripts/build_lunatranslator.py | 8 +++++++- py/generate_xp_code.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/scripts/build_lunatranslator.py b/.github/scripts/build_lunatranslator.py index ff23b09f..3cebb82c 100644 --- a/.github/scripts/build_lunatranslator.py +++ b/.github/scripts/build_lunatranslator.py @@ -29,6 +29,7 @@ mylinks = { "ocr_models": { "ja.zip": "https://github.com/test123456654321/RESOURCES/releases/download/ocr_models/ja.zip", }, + "mecab_xp.zip": "https://github.com/HIllya51/RESOURCES/releases/download/common/mecab_xp.zip", "mecab.zip": "https://github.com/HIllya51/RESOURCES/releases/download/common/mecab.zip", "magpie.zip": "https://github.com/HIllya51/RESOURCES/releases/download/common/magpie.zip", "themes.zip": "https://github.com/HIllya51/RESOURCES/releases/download/common/themes.zip", @@ -122,6 +123,11 @@ def downloadmecab(): subprocess.run(f"curl -LO {mylinks['mecab.zip']}") subprocess.run(f"7z x mecab.zip -oALL") move_directory_contents("ALL/ALL", f"{rootDir}/files/plugins") +def downloadmecabxp(): + os.chdir(rootDir + "\\temp") + subprocess.run(f"curl -LO {mylinks['mecab_xp.zip']}") + subprocess.run(f"7z x mecab_xp.zip -oALL") + move_directory_contents("ALL/ALL", f"{rootDir}/files/plugins") def downloadmapie(): os.chdir(rootDir + "\\temp") @@ -276,7 +282,6 @@ if __name__ == "__main__": elif sys.argv[1] == "merge": createPluginDirs(0 if arch == "xp" else 1) downloadNtlea() - downloadmecab() downloadbass() os.chdir(rootDir) if arch == "xp": @@ -299,6 +304,7 @@ if __name__ == "__main__": os.chdir(rootDir) os.system(f"python {os.path.join(rootthisfiledir,'collectall_xp.py')}") exit() + downloadmecab() downloadLocaleEmulator() downloadBrotli() downloadCurl() diff --git a/py/generate_xp_code.py b/py/generate_xp_code.py index 1de2033a..214c1ede 100644 --- a/py/generate_xp_code.py +++ b/py/generate_xp_code.py @@ -28,7 +28,7 @@ def parsecode(code: str): ) # 移除类型注解 code = re.sub(r": [a-zA-Z0-9_]+\)", ")", code) - code = re.sub(r": [a-zA-Z0-9_]+,", ",", code) + code = re.sub(r"([a-zA-Z0-9_]): [a-zA-Z0-9_]+,", r"\1,", code) code = re.sub(r": [a-zA-Z0-9_]+ =", " =", code) return code