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