From 846cff1dc34c338cdbdbf76e4e977ccb46ad1695 Mon Sep 17 00:00:00 2001 From: Suisuroru Date: Sat, 21 Sep 2024 23:40:14 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96uuid=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Suya_Downloader.py | 4 ++-- Updater.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Suya_Downloader.py b/Suya_Downloader.py index ca5c697..2013be5 100644 --- a/Suya_Downloader.py +++ b/Suya_Downloader.py @@ -5,7 +5,6 @@ import sys import threading import tkinter as tk -import uuid from errno import EEXIST from getpass import getuser from queue import Queue @@ -13,6 +12,7 @@ from tempfile import mkdtemp, NamedTemporaryFile from time import time, sleep from tkinter import scrolledtext, ttk, filedialog, messagebox as msgbox +from uuid import uuid4 as uuid from webbrowser import open as webopen from winreg import OpenKey, HKEY_CURRENT_USER, QueryValueEx from zipfile import ZipFile, BadZipFile @@ -1398,7 +1398,7 @@ def download_and_install(update_url, version): temp_dir = mkdtemp() # 生成一个随机的 UUID 字符串,并转换为纯数字的子串作为文件名 - random_filename = str(uuid.uuid4()) + ".zip" + random_filename = str(uuid()) + ".zip" temp_zip_file = os.path.join(temp_dir, random_filename) # 将响应内容写入临时文件 diff --git a/Updater.py b/Updater.py index 5fab4de..7fd18a8 100644 --- a/Updater.py +++ b/Updater.py @@ -4,9 +4,9 @@ import shutil import sys import threading -import uuid from tempfile import mkdtemp from tkinter import messagebox as msgbox +from uuid import uuid4 as uuid from zipfile import ZipFile import requests @@ -200,7 +200,7 @@ def download_and_install(downloader_update_url, updater_method_inner): # 定义临时目录和临时文件 temp_dir = mkdtemp() # 生成一个随机的 UUID 字符串,并转换为纯数字的子串作为文件名 - random_filename = str(uuid.uuid4()) + ".zip" + random_filename = str(uuid()) + ".zip" temp_zip_file = os.path.join(temp_dir, random_filename) # 将响应内容写入临时文件 with open(temp_zip_file, "wb", encoding="utf-8") as f: