修改文件位置

This commit is contained in:
shuaikangzhou
2023-12-23 15:25:02 +08:00
parent b1a6f52148
commit 5916e55c1b
6 changed files with 4780 additions and 6618 deletions

View File

@@ -1,5 +1,6 @@
import json
import os.path
import sys
import time
import traceback
@@ -49,14 +50,12 @@ class DecryptControl(QWidget, decryptUi.Ui_Dialog):
# @log
def get_info(self):
try:
file = QFile(':/data/version_list.json')
if file.open(QIODevice.ReadOnly | QIODevice.Text):
stream = QTextStream(file)
content = stream.readAll()
file.close()
VERSION_LIST = json.loads(content)
else:
return
file_path = './app/resources/version_list.json'
if not os.path.exists(file_path):
resource_dir = getattr(sys, '_MEIPASS', os.path.abspath(os.path.dirname(__file__)))
file_path = os.path.join(resource_dir, 'app', 'resources', 'version_list.json')
with open(file_path, "r", encoding="utf-8") as f:
VERSION_LIST = json.loads(f.read())
result = get_wx_info.get_info(VERSION_LIST)
print(result)
if result == -1: