支持导入.7z包时自动移除部分特殊符号
Some checks are pending
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Waiting to run
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Waiting to run

This commit is contained in:
2024-07-15 21:46:24 +08:00
parent e3c54ffc32
commit f1decf51d1
2 changed files with 10 additions and 1 deletions

View File

@@ -144,8 +144,15 @@ def InstallOtherWine():
rfile = open(f"{programPath}/winelist.json", "r")
list = json.loads(rfile.read())
rfile.close()
# 创建映射
name = os.path.splitext(os.path.basename(path[0]))[0]
removeSymbol = ["(", ")", "", "", " ", "!", "@", "#",
"$", "%", "^", "&", "*", "=", "[", "]",
"{", "}", "\\", "/", "|", "?",
"<", ">", "·", "「", ";", ":", "",
"", "《", "》", "", "。", ",", ".",
"`", "~", "", "、"]
for i in removeSymbol:
name.replace(i, "")
unpackPath = f"{programPath}/{name}"
shellCommand = f"""mkdir -p \"{unpackPath}\"
7z x -y \"{path[0]}\" -o\"{unpackPath}\"