mirror of
https://github.com/LC044/WeChatMsg
synced 2025-02-22 19:02:17 +08:00
新增加载动画
This commit is contained in:
parent
a21e2d657a
commit
4110dd0de9
@ -10,6 +10,7 @@ from pilk import decode
|
|||||||
lock = threading.Lock()
|
lock = threading.Lock()
|
||||||
db_path = "./app/Database/Msg/MediaMSG.db"
|
db_path = "./app/Database/Msg/MediaMSG.db"
|
||||||
|
|
||||||
|
|
||||||
def get_ffmpeg_path():
|
def get_ffmpeg_path():
|
||||||
# 获取打包后的资源目录
|
# 获取打包后的资源目录
|
||||||
resource_dir = getattr(sys, '_MEIPASS', os.path.abspath(os.path.dirname(__file__)))
|
resource_dir = getattr(sys, '_MEIPASS', os.path.abspath(os.path.dirname(__file__)))
|
||||||
@ -18,6 +19,8 @@ def get_ffmpeg_path():
|
|||||||
ffmpeg_path = os.path.join(resource_dir, 'app', 'resources', 'ffmpeg.exe')
|
ffmpeg_path = os.path.join(resource_dir, 'app', 'resources', 'ffmpeg.exe')
|
||||||
|
|
||||||
return ffmpeg_path
|
return ffmpeg_path
|
||||||
|
|
||||||
|
|
||||||
def singleton(cls):
|
def singleton(cls):
|
||||||
_instance = {}
|
_instance = {}
|
||||||
|
|
||||||
@ -28,6 +31,7 @@ def singleton(cls):
|
|||||||
|
|
||||||
return inner
|
return inner
|
||||||
|
|
||||||
|
|
||||||
@singleton
|
@singleton
|
||||||
class MediaMsg:
|
class MediaMsg:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -76,8 +80,8 @@ class MediaMsg:
|
|||||||
with open(silk_path, "wb") as f:
|
with open(silk_path, "wb") as f:
|
||||||
f.write(buf)
|
f.write(buf)
|
||||||
# open(silk_path, "wb").write()
|
# open(silk_path, "wb").write()
|
||||||
decode(silk_path, pcm_path, 44100)
|
|
||||||
try:
|
try:
|
||||||
|
decode(silk_path, pcm_path, 44100)
|
||||||
# 调用系统上的 ffmpeg 可执行文件
|
# 调用系统上的 ffmpeg 可执行文件
|
||||||
# 获取 FFmpeg 可执行文件的路径
|
# 获取 FFmpeg 可执行文件的路径
|
||||||
ffmpeg_path = get_ffmpeg_path()
|
ffmpeg_path = get_ffmpeg_path()
|
||||||
@ -90,18 +94,20 @@ class MediaMsg:
|
|||||||
# 这里不知道怎么捕捉异常
|
# 这里不知道怎么捕捉异常
|
||||||
cmd = f'''{os.path.join(os.getcwd(), 'app', 'resources', 'ffmpeg.exe')} -loglevel quiet -y -f s16le -i {pcm_path} -ar 44100 -ac 1 {mp3_path}'''
|
cmd = f'''{os.path.join(os.getcwd(), 'app', 'resources', 'ffmpeg.exe')} -loglevel quiet -y -f s16le -i {pcm_path} -ar 44100 -ac 1 {mp3_path}'''
|
||||||
system(cmd)
|
system(cmd)
|
||||||
except subprocess.CalledProcessError as e:
|
except Exception as e:
|
||||||
print(f"Error: {e}")
|
print(f"Error: {e}")
|
||||||
cmd = f'''{os.path.join(os.getcwd(),'app','resources','ffmpeg.exe')} -loglevel quiet -y -f s16le -i {pcm_path} -ar 44100 -ac 1 {mp3_path}'''
|
cmd = f'''{os.path.join(os.getcwd(), 'app', 'resources', 'ffmpeg.exe')} -loglevel quiet -y -f s16le -i {pcm_path} -ar 44100 -ac 1 {mp3_path}'''
|
||||||
system(cmd)
|
system(cmd)
|
||||||
system(f'del {silk_path}')
|
system(f'del {silk_path}')
|
||||||
system(f'del {pcm_path}')
|
system(f'del {pcm_path}')
|
||||||
print(mp3_path)
|
print(mp3_path)
|
||||||
return mp3_path
|
return mp3_path
|
||||||
|
|
||||||
def get_audio_path(self, reserved0, output_path):
|
def get_audio_path(self, reserved0, output_path):
|
||||||
mp3_path = f"{output_path}\\{reserved0}.mp3"
|
mp3_path = f"{output_path}\\{reserved0}.mp3"
|
||||||
mp3_path = mp3_path.replace("/", "\\")
|
mp3_path = mp3_path.replace("/", "\\")
|
||||||
return mp3_path
|
return mp3_path
|
||||||
|
|
||||||
def get_audio_text(self, content):
|
def get_audio_text(self, content):
|
||||||
try:
|
try:
|
||||||
root = ET.fromstring(content)
|
root = ET.fromstring(content)
|
||||||
@ -109,6 +115,7 @@ class MediaMsg:
|
|||||||
return transtext
|
return transtext
|
||||||
except:
|
except:
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
if self.open_flag:
|
if self.open_flag:
|
||||||
try:
|
try:
|
||||||
@ -121,6 +128,7 @@ class MediaMsg:
|
|||||||
def __del__(self):
|
def __del__(self):
|
||||||
self.close()
|
self.close()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
db_path = './Msg/MediaMSG.db'
|
db_path = './Msg/MediaMSG.db'
|
||||||
media_msg_db = MediaMsg()
|
media_msg_db = MediaMsg()
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import os
|
import os
|
||||||
import sqlite3
|
import sqlite3
|
||||||
|
|
||||||
|
|
||||||
def merge_MediaMSG_databases(source_paths, target_path):
|
def merge_MediaMSG_databases(source_paths, target_path):
|
||||||
# 创建目标数据库连接
|
# 创建目标数据库连接
|
||||||
target_conn = sqlite3.connect(target_path)
|
target_conn = sqlite3.connect(target_path)
|
||||||
@ -19,7 +20,6 @@ def merge_MediaMSG_databases(source_paths, target_path):
|
|||||||
sql = '''SELECT Key,Reserved0,Buf,Reserved1,Reserved2 FROM Media;'''
|
sql = '''SELECT Key,Reserved0,Buf,Reserved1,Reserved2 FROM Media;'''
|
||||||
cursor.execute(sql)
|
cursor.execute(sql)
|
||||||
result = cursor.fetchall()
|
result = cursor.fetchall()
|
||||||
|
|
||||||
target_cursor.executemany(
|
target_cursor.executemany(
|
||||||
"INSERT INTO Media (Key,Reserved0,Buf,Reserved1,Reserved2)"
|
"INSERT INTO Media (Key,Reserved0,Buf,Reserved1,Reserved2)"
|
||||||
"VALUES(?,?,?,?,?)",
|
"VALUES(?,?,?,?,?)",
|
||||||
@ -42,6 +42,7 @@ def merge_MediaMSG_databases(source_paths, target_path):
|
|||||||
# 关闭目标数据库连接
|
# 关闭目标数据库连接
|
||||||
target_conn.close()
|
target_conn.close()
|
||||||
|
|
||||||
|
|
||||||
def merge_databases(source_paths, target_path):
|
def merge_databases(source_paths, target_path):
|
||||||
# 创建目标数据库连接
|
# 创建目标数据库连接
|
||||||
target_conn = sqlite3.connect(target_path)
|
target_conn = sqlite3.connect(target_path)
|
||||||
@ -55,6 +56,7 @@ def merge_databases(source_paths, target_path):
|
|||||||
db = sqlite3.connect(source_path)
|
db = sqlite3.connect(source_path)
|
||||||
db.text_factory = str
|
db.text_factory = str
|
||||||
cursor = db.cursor()
|
cursor = db.cursor()
|
||||||
|
try:
|
||||||
sql = '''
|
sql = '''
|
||||||
SELECT TalkerId,MsgsvrID,Type,SubType,IsSender,CreateTime,Sequence,StrTalker,StrContent,DisplayContent,BytesExtra,CompressContent
|
SELECT TalkerId,MsgsvrID,Type,SubType,IsSender,CreateTime,Sequence,StrTalker,StrContent,DisplayContent,BytesExtra,CompressContent
|
||||||
FROM MSG;
|
FROM MSG;
|
||||||
@ -68,6 +70,8 @@ def merge_databases(source_paths, target_path):
|
|||||||
"BytesExtra,CompressContent)"
|
"BytesExtra,CompressContent)"
|
||||||
"VALUES(?,?,?,?,?,?,?,?,?,?,?,?)",
|
"VALUES(?,?,?,?,?,?,?,?,?,?,?,?)",
|
||||||
result)
|
result)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
cursor.close()
|
cursor.close()
|
||||||
db.close()
|
db.close()
|
||||||
# 提交事务
|
# 提交事务
|
||||||
|
@ -28,6 +28,14 @@
|
|||||||
<file>icons/folder.svg</file>
|
<file>icons/folder.svg</file>
|
||||||
<file>icons/start.svg</file>
|
<file>icons/start.svg</file>
|
||||||
<file>icons/decrypt.svg</file>
|
<file>icons/decrypt.svg</file>
|
||||||
|
<file>icons/Cursors/0.png</file>
|
||||||
|
<file>icons/Cursors/1.png</file>
|
||||||
|
<file>icons/Cursors/2.png</file>
|
||||||
|
<file>icons/Cursors/3.png</file>
|
||||||
|
<file>icons/Cursors/4.png</file>
|
||||||
|
<file>icons/Cursors/5.png</file>
|
||||||
|
<file>icons/Cursors/6.png</file>
|
||||||
|
<file>icons/Cursors/7.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
<qresource prefix="/data">
|
<qresource prefix="/data">
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -22,6 +22,7 @@ from .chat import ChatWindow
|
|||||||
from .contact import ContactWindow
|
from .contact import ContactWindow
|
||||||
from .tool.tool_window import ToolWindow
|
from .tool.tool_window import ToolWindow
|
||||||
from ..DataBase.output_pc import Output
|
from ..DataBase.output_pc import Output
|
||||||
|
from ..components.QCursorGif import QCursorGif
|
||||||
from ..person import MePC
|
from ..person import MePC
|
||||||
|
|
||||||
# 美化样式表
|
# 美化样式表
|
||||||
@ -69,7 +70,7 @@ HistoryPanel::item:hover {
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
class MainWinController(QMainWindow, mainwindow.Ui_MainWindow):
|
class MainWinController(QMainWindow, mainwindow.Ui_MainWindow,QCursorGif):
|
||||||
exitSignal = pyqtSignal(bool)
|
exitSignal = pyqtSignal(bool)
|
||||||
okSignal = pyqtSignal(bool)
|
okSignal = pyqtSignal(bool)
|
||||||
|
|
||||||
@ -79,6 +80,10 @@ class MainWinController(QMainWindow, mainwindow.Ui_MainWindow):
|
|||||||
self.outputThread0 = None
|
self.outputThread0 = None
|
||||||
self.outputThread = None
|
self.outputThread = None
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
# 设置忙碌光标图片数组
|
||||||
|
self.initCursor([':/icons/icons/Cursors/%d.png' %
|
||||||
|
i for i in range(8)], self)
|
||||||
|
self.setCursorTimeout(100)
|
||||||
# self.setWindowIcon(Icon.MainWindow_Icon)
|
# self.setWindowIcon(Icon.MainWindow_Icon)
|
||||||
pixmap = QPixmap(Icon.logo_ico_path)
|
pixmap = QPixmap(Icon.logo_ico_path)
|
||||||
icon = QIcon(pixmap)
|
icon = QIcon(pixmap)
|
||||||
@ -208,6 +213,7 @@ class MainWinController(QMainWindow, mainwindow.Ui_MainWindow):
|
|||||||
self.stackedWidget.setCurrentIndex(0)
|
self.stackedWidget.setCurrentIndex(0)
|
||||||
|
|
||||||
def output(self):
|
def output(self):
|
||||||
|
self.startBusy()
|
||||||
if self.sender() == self.action_output_CSV:
|
if self.sender() == self.action_output_CSV:
|
||||||
self.outputThread = Output(None, type_=Output.CSV_ALL)
|
self.outputThread = Output(None, type_=Output.CSV_ALL)
|
||||||
self.outputThread.okSignal.connect(
|
self.outputThread.okSignal.connect(
|
||||||
@ -220,6 +226,7 @@ class MainWinController(QMainWindow, mainwindow.Ui_MainWindow):
|
|||||||
self.outputThread.start()
|
self.outputThread.start()
|
||||||
|
|
||||||
def message(self, msg):
|
def message(self, msg):
|
||||||
|
self.stopBusy()
|
||||||
QMessageBox.about(self, "提醒", msg)
|
QMessageBox.about(self, "提醒", msg)
|
||||||
|
|
||||||
def about(self):
|
def about(self):
|
||||||
|
@ -3,13 +3,15 @@ import os.path
|
|||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
|
from typing import List
|
||||||
|
|
||||||
from PyQt5.QtCore import pyqtSignal, QThread, QUrl, QFile, QIODevice, QTextStream
|
from PyQt5.QtCore import pyqtSignal, QThread, QUrl
|
||||||
from PyQt5.QtGui import QDesktopServices
|
from PyQt5.QtGui import QDesktopServices
|
||||||
from PyQt5.QtWidgets import QWidget, QMessageBox, QFileDialog
|
from PyQt5.QtWidgets import QWidget, QMessageBox, QFileDialog
|
||||||
|
|
||||||
from app.DataBase import msg_db, misc_db, media_msg_db, close_db
|
from app.DataBase import msg_db, misc_db, close_db
|
||||||
from app.DataBase.merge import merge_databases, merge_MediaMSG_databases
|
from app.DataBase.merge import merge_databases, merge_MediaMSG_databases
|
||||||
|
from app.components.QCursorGif import QCursorGif
|
||||||
from app.decrypt import get_wx_info, decrypt
|
from app.decrypt import get_wx_info, decrypt
|
||||||
from app.log import logger
|
from app.log import logger
|
||||||
from app.util import path
|
from app.util import path
|
||||||
@ -17,14 +19,17 @@ from . import decryptUi
|
|||||||
from ...Icon import Icon
|
from ...Icon import Icon
|
||||||
|
|
||||||
|
|
||||||
class DecryptControl(QWidget, decryptUi.Ui_Dialog):
|
class DecryptControl(QWidget, decryptUi.Ui_Dialog, QCursorGif):
|
||||||
DecryptSignal = pyqtSignal(bool)
|
DecryptSignal = pyqtSignal(bool)
|
||||||
get_wxidSignal = pyqtSignal(str)
|
get_wxidSignal = pyqtSignal(str)
|
||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super(DecryptControl, self).__init__(parent)
|
super(DecryptControl, self).__init__(parent)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
# 设置忙碌光标图片数组
|
||||||
|
self.initCursor([':/icons/icons/Cursors/%d.png' %
|
||||||
|
i for i in range(8)], self)
|
||||||
|
self.setCursorTimeout(100)
|
||||||
self.btn_start.clicked.connect(self.decrypt)
|
self.btn_start.clicked.connect(self.decrypt)
|
||||||
self.btn_getinfo.clicked.connect(self.get_info)
|
self.btn_getinfo.clicked.connect(self.get_info)
|
||||||
self.btn_db_dir.clicked.connect(self.select_db_dir)
|
self.btn_db_dir.clicked.connect(self.select_db_dir)
|
||||||
@ -49,21 +54,21 @@ class DecryptControl(QWidget, decryptUi.Ui_Dialog):
|
|||||||
|
|
||||||
# @log
|
# @log
|
||||||
def get_info(self):
|
def get_info(self):
|
||||||
try:
|
self.startBusy()
|
||||||
file_path = './app/resources/version_list.json'
|
self.get_info_thread = MyThread()
|
||||||
if not os.path.exists(file_path):
|
self.get_info_thread.signal.connect(self.set_info)
|
||||||
resource_dir = getattr(sys, '_MEIPASS', os.path.abspath(os.path.dirname(__file__)))
|
self.get_info_thread.start()
|
||||||
file_path = os.path.join(resource_dir, 'app', 'resources', 'version_list.json')
|
|
||||||
with open(file_path, "r", encoding="utf-8") as f:
|
def set_info(self, result):
|
||||||
VERSION_LIST = json.loads(f.read())
|
# print(result)
|
||||||
result = get_wx_info.get_info(VERSION_LIST)
|
if result[0] == -1:
|
||||||
print(result)
|
|
||||||
if result == -1:
|
|
||||||
QMessageBox.critical(self, "错误", "请登录微信")
|
QMessageBox.critical(self, "错误", "请登录微信")
|
||||||
elif result == -2:
|
elif result[0] == -2:
|
||||||
QMessageBox.critical(self, "错误", "微信版本不匹配\n请更新微信版本为:3.9.8.15")
|
QMessageBox.critical(self, "错误", "微信版本不匹配\n请更新微信版本为:3.9.8.25")
|
||||||
elif result == -3:
|
elif result[0] == -3:
|
||||||
QMessageBox.critical(self, "错误", "WeChat WeChatWin.dll Not Found")
|
QMessageBox.critical(self, "错误", "WeChat WeChatWin.dll Not Found")
|
||||||
|
elif result[0] == -10086:
|
||||||
|
QMessageBox.critical(self, "错误", "未知错误,请收集错误信息")
|
||||||
else:
|
else:
|
||||||
self.ready = True
|
self.ready = True
|
||||||
self.info = result[0]
|
self.info = result[0]
|
||||||
@ -86,9 +91,7 @@ class DecryptControl(QWidget, decryptUi.Ui_Dialog):
|
|||||||
self.label_ready.setText('已就绪')
|
self.label_ready.setText('已就绪')
|
||||||
if self.wx_dir and os.path.exists(os.path.join(self.wx_dir)):
|
if self.wx_dir and os.path.exists(os.path.join(self.wx_dir)):
|
||||||
self.label_ready.setText('已就绪')
|
self.label_ready.setText('已就绪')
|
||||||
except Exception as e:
|
self.stopBusy()
|
||||||
QMessageBox.critical(self, "未知错误", "请收集报错信息,发起issue解决问题")
|
|
||||||
logger.error(traceback.format_exc())
|
|
||||||
|
|
||||||
def set_wxid_(self):
|
def set_wxid_(self):
|
||||||
self.info['wxid'] = self.lineEdit.text()
|
self.info['wxid'] = self.lineEdit.text()
|
||||||
@ -129,7 +132,8 @@ class DecryptControl(QWidget, decryptUi.Ui_Dialog):
|
|||||||
QMessageBox.critical(self, "错误", "文件夹选择错误\n一般以wxid_xxx结尾")
|
QMessageBox.critical(self, "错误", "文件夹选择错误\n一般以wxid_xxx结尾")
|
||||||
return
|
return
|
||||||
if self.info.get('key') == 'None':
|
if self.info.get('key') == 'None':
|
||||||
QMessageBox.critical(self, "错误", "密钥错误\n将软件放在桌面上试试\n如果还不可以的话我也我能为力,您可以等待后续版本解决该问题")
|
QMessageBox.critical(self, "错误",
|
||||||
|
"密钥错误\n将软件放在桌面上试试\n如果还不可以的话我也我能为力,您可以等待后续版本解决该问题")
|
||||||
close_db()
|
close_db()
|
||||||
self.label_tip.setVisible(True)
|
self.label_tip.setVisible(True)
|
||||||
self.label_tip.setText('点我之后没有反应那就多等儿吧,不要再点了')
|
self.label_tip.setText('点我之后没有反应那就多等儿吧,不要再点了')
|
||||||
@ -179,32 +183,6 @@ class DecryptControl(QWidget, decryptUi.Ui_Dialog):
|
|||||||
except:
|
except:
|
||||||
with open('./info.json', 'w', encoding='utf-8') as f:
|
with open('./info.json', 'w', encoding='utf-8') as f:
|
||||||
f.write(json.dumps(dic))
|
f.write(json.dumps(dic))
|
||||||
# 目标数据库文件
|
|
||||||
target_database = "app/DataBase/Msg/MSG.db"
|
|
||||||
# 源数据库文件列表
|
|
||||||
source_databases = [f"app/DataBase/Msg/MSG{i}.db" for i in range(1, 200)]
|
|
||||||
import shutil
|
|
||||||
if os.path.exists(target_database):
|
|
||||||
os.remove(target_database)
|
|
||||||
shutil.copy2("app/DataBase/Msg/MSG0.db", target_database) # 使用一个数据库文件作为模板
|
|
||||||
# 合并数据库
|
|
||||||
try:
|
|
||||||
merge_databases(source_databases, target_database)
|
|
||||||
except FileNotFoundError:
|
|
||||||
QMessageBox.critical(self, "错误", "数据库不存在\n请检查微信版本是否为最新")
|
|
||||||
|
|
||||||
# 音频数据库文件
|
|
||||||
target_database = "app/DataBase/Msg/MediaMSG.db"
|
|
||||||
# 源数据库文件列表
|
|
||||||
if os.path.exists(target_database):
|
|
||||||
os.remove(target_database)
|
|
||||||
source_databases = [f"app/DataBase/Msg/MediaMSG{i}.db" for i in range(1, 200)]
|
|
||||||
shutil.copy2("app/DataBase/Msg/MediaMSG0.db", target_database) # 使用一个数据库文件作为模板
|
|
||||||
# 合并数据库
|
|
||||||
try:
|
|
||||||
merge_MediaMSG_databases(source_databases, target_database)
|
|
||||||
except FileNotFoundError:
|
|
||||||
QMessageBox.critical(self, "错误", "数据库不存在\n请检查微信版本是否为最新")
|
|
||||||
|
|
||||||
self.DecryptSignal.emit(True)
|
self.DecryptSignal.emit(True)
|
||||||
self.close()
|
self.close()
|
||||||
@ -249,12 +227,38 @@ class DecryptThread(QThread):
|
|||||||
self.errorSignal.emit(True)
|
self.errorSignal.emit(True)
|
||||||
self.signal.emit(str(i))
|
self.signal.emit(str(i))
|
||||||
# print(self.db_path)
|
# print(self.db_path)
|
||||||
|
# 目标数据库文件
|
||||||
|
target_database = "app/DataBase/Msg/MSG.db"
|
||||||
|
# 源数据库文件列表
|
||||||
|
source_databases = [f"app/DataBase/Msg/MSG{i}.db" for i in range(1, 200)]
|
||||||
|
import shutil
|
||||||
|
if os.path.exists(target_database):
|
||||||
|
os.remove(target_database)
|
||||||
|
shutil.copy2("app/DataBase/Msg/MSG0.db", target_database) # 使用一个数据库文件作为模板
|
||||||
|
# 合并数据库
|
||||||
|
try:
|
||||||
|
merge_databases(source_databases, target_database)
|
||||||
|
except FileNotFoundError:
|
||||||
|
QMessageBox.critical("错误", "数据库不存在\n请检查微信版本是否为最新")
|
||||||
|
|
||||||
|
# 音频数据库文件
|
||||||
|
target_database = "app/DataBase/Msg/MediaMSG.db"
|
||||||
|
# 源数据库文件列表
|
||||||
|
if os.path.exists(target_database):
|
||||||
|
os.remove(target_database)
|
||||||
|
source_databases = [f"app/DataBase/Msg/MediaMSG{i}.db" for i in range(1, 200)]
|
||||||
|
shutil.copy2("app/DataBase/Msg/MediaMSG0.db", target_database) # 使用一个数据库文件作为模板
|
||||||
|
# 合并数据库
|
||||||
|
try:
|
||||||
|
merge_MediaMSG_databases(source_databases, target_database)
|
||||||
|
except FileNotFoundError:
|
||||||
|
QMessageBox.critical("错误", "数据库不存在\n请检查微信版本是否为最新")
|
||||||
self.okSignal.emit('ok')
|
self.okSignal.emit('ok')
|
||||||
# self.signal.emit('100')
|
# self.signal.emit('100')
|
||||||
|
|
||||||
|
|
||||||
class MyThread(QThread):
|
class MyThread(QThread):
|
||||||
signal = pyqtSignal(str)
|
signal = pyqtSignal(list)
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(MyThread, self).__init__()
|
super(MyThread, self).__init__()
|
||||||
@ -263,6 +267,21 @@ class MyThread(QThread):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
for i in range(100):
|
file_path = './app/resources/version_list.json'
|
||||||
self.signal.emit(str(i))
|
if not os.path.exists(file_path):
|
||||||
time.sleep(0.1)
|
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())
|
||||||
|
try:
|
||||||
|
result = get_wx_info.get_info(VERSION_LIST)
|
||||||
|
if result == -1:
|
||||||
|
result = [result]
|
||||||
|
elif result == -2:
|
||||||
|
result = [result]
|
||||||
|
elif result == -3:
|
||||||
|
result = [result]
|
||||||
|
except:
|
||||||
|
logger.error(traceback.format_exc())
|
||||||
|
result = [-10086]
|
||||||
|
self.signal.emit(result)
|
||||||
|
3
main.py
3
main.py
@ -62,6 +62,9 @@ class ViewController(QWidget):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
import cgitb
|
||||||
|
|
||||||
|
cgitb.enable(format='text')
|
||||||
app = QApplication(sys.argv)
|
app = QApplication(sys.argv)
|
||||||
font = QFont('微软雅黑', 12) # 使用 Times New Roman 字体,字体大小为 14
|
font = QFont('微软雅黑', 12) # 使用 Times New Roman 字体,字体大小为 14
|
||||||
app.setFont(font)
|
app.setFont(font)
|
||||||
|
Loading…
Reference in New Issue
Block a user