代码样式调整:去除没有变量引用的字符串的f前缀,修改变量为下划线风格命名

This commit is contained in:
li-xiaochen 2024-12-12 13:14:54 +08:00
parent 8a9b8d1c47
commit 89c4121f61

View file

@ -283,16 +283,16 @@ class Api:
folder_path = os.path.join(os.getcwd(), "_internal")
exe_path = os.path.join(os.getcwd(), "launcher.exe")
with open(script_path, "w") as b:
TempList = f"@echo off\n"
TempList += f"timeout /t 3 /nobreak\n" # 等待进程退出
TempList += f"rmdir {folder_path}\n" # 删除_internal
TempList += f"del {exe_path}\n" # 删除exe
TempList += f"tar -xf {download_path} -C ..\n" # 解压压缩包
TempList += f"timeout /t 1 /nobreak\n" # 等待解压
TempList += f"start {exe_path}\n" # 启动新程序
TempList += f"del {download_path}\n" # 删除压缩包
TempList += f"exit"
b.write(TempList)
temp_list = "@echo off\n"
temp_list += "timeout /t 3 /nobreak\n" # 等待进程退出
temp_list += f"rmdir {folder_path}\n" # 删除_internal
temp_list += f"del {exe_path}\n" # 删除exe
temp_list += f"tar -xf {download_path} -C ..\n" # 解压压缩包
temp_list += "timeout /t 1 /nobreak\n" # 等待解压
temp_list += f"start {exe_path}\n" # 启动新程序
temp_list += f"del {download_path}\n" # 删除压缩包
temp_list += "exit"
b.write(temp_list)
# 不显示cmd窗口
Popen([script_path], creationflags=CREATE_NO_WINDOW)
os._exit(0)