This commit is contained in:
恍兮惚兮 2024-11-16 23:20:48 +08:00
parent 53d5866975
commit 4be5fc6ba9
3 changed files with 17 additions and 10 deletions

View File

@ -69,12 +69,16 @@ def trygetupdate():
def doupdate():
if not gobject.baseobject.update_avalable:
return
if platform.architecture()[0] == "64bit":
bit = ""
_6432 = "64"
elif platform.architecture()[0] == "32bit":
bit = "_x86"
plat = get_platform()
if plat == "xp":
_6432 = "32"
bit = "_x86_winxp"
elif plat == "32":
bit = "_x86"
_6432 = plat
elif plat == "64":
bit = ""
_6432 = plat
shutil.copy(
r".\files\plugins\shareddllproxy{}.exe".format(_6432),
gobject.getcachedir("Updater.exe"),
@ -89,9 +93,11 @@ def doupdate():
def updatemethod_checkalready(size, savep, sha256):
if not os.path.exists(savep):
return False
stats = os.stat(savep)
if stats.st_size != size:
return False
if get_platform() != "xp":
# requests旧版本重定向的resp.headers不正确
stats = os.stat(savep)
if stats.st_size != size:
return False
if not sha256:
return True
with open(savep, "rb") as ff:

@ -1 +1 @@
Subproject commit 7793456f3844866866612c07e5edc09128d6c99a
Subproject commit 6695d90cbff787f0614eae5db49e9d9b97ed802b

View File

@ -28,7 +28,8 @@ 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_]+,", ",", code)
code = re.sub(r": [a-zA-Z0-9_]+ =", " =", code)
return code