fix build exe error
This commit is contained in:
parent
33da8c4b78
commit
0c727dc34f
11
__init__.py
Normal file
11
__init__.py
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# -*- coding: utf-8 -*-#
|
||||||
|
# -------------------------------------------------------------------------------
|
||||||
|
# Name: __init__.py.py
|
||||||
|
# Description:
|
||||||
|
# Author: xaoyaoo
|
||||||
|
# Date: 2024/08/17
|
||||||
|
# -------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
pass
|
@ -22,7 +22,6 @@ from .wx_core import merge_db, decrypt_merge, merge_real_time_db, all_merge_real
|
|||||||
from .db import DBHandler, MsgHandler, MicroHandler, MediaHandler, OpenIMContactHandler, FavoriteHandler, \
|
from .db import DBHandler, MsgHandler, MicroHandler, MediaHandler, OpenIMContactHandler, FavoriteHandler, \
|
||||||
PublicMsgHandler
|
PublicMsgHandler
|
||||||
from .api import start_server, app
|
from .api import start_server, app
|
||||||
from .analyzer import DBPool
|
|
||||||
|
|
||||||
# PYWXDUMP_ROOT_PATH = os.path.dirname(__file__)
|
# PYWXDUMP_ROOT_PATH = os.path.dirname(__file__)
|
||||||
# db_init = DBPool("DBPOOL_INIT")
|
# db_init = DBPool("DBPOOL_INIT")
|
||||||
@ -30,5 +29,6 @@ from .analyzer import DBPool
|
|||||||
|
|
||||||
__all__ = ["BiasAddr", "get_wx_info", "get_wx_db", "batch_decrypt", "decrypt", "get_core_db",
|
__all__ = ["BiasAddr", "get_wx_info", "get_wx_db", "batch_decrypt", "decrypt", "get_core_db",
|
||||||
"merge_db", "decrypt_merge", "merge_real_time_db", "all_merge_real_time_db",
|
"merge_db", "decrypt_merge", "merge_real_time_db", "all_merge_real_time_db",
|
||||||
"MsgHandler", "MicroHandler", "MediaHandler", "OpenIMContactHandler", "FavoriteHandler", "PublicMsgHandler",
|
"DBHandler", "MsgHandler", "MicroHandler", "MediaHandler", "OpenIMContactHandler", "FavoriteHandler",
|
||||||
"DBHandler", "start_server", "WX_OFFS", "WX_OFFS_PATH", "__version__", "app"]
|
"PublicMsgHandler",
|
||||||
|
"start_server", "WX_OFFS", "WX_OFFS_PATH", "__version__", "app"]
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
import csv
|
import csv
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
from ..__init__ import DBHandler
|
from pywxdump.db import DBHandler
|
||||||
|
|
||||||
|
|
||||||
def export_csv(wxid, outpath, db_config, my_wxid="我", page_size=5000):
|
def export_csv(wxid, outpath, db_config, my_wxid="我", page_size=5000):
|
@ -7,7 +7,7 @@
|
|||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
from ..__init__ import DBHandler
|
from pywxdump.db import DBHandler
|
||||||
|
|
||||||
|
|
||||||
def export_html(wxid, outpath, db_config, my_wxid="我"):
|
def export_html(wxid, outpath, db_config, my_wxid="我"):
|
@ -7,7 +7,7 @@
|
|||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
from ..__init__ import DBHandler
|
from pywxdump.db import DBHandler
|
||||||
|
|
||||||
|
|
||||||
def export_json(wxid, outpath, db_config, my_wxid="我", indent=4):
|
def export_json(wxid, outpath, db_config, my_wxid="我", indent=4):
|
@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-#
|
# -*- coding: utf-8 -*-#
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
# Name: chat_api.py
|
# Name: remote_server.py
|
||||||
# Description:
|
# Description:
|
||||||
# Author: xaoyaoo
|
# Author: xaoyaoo
|
||||||
# Date: 2024/01/02
|
# Date: 2024/01/02
|
||||||
@ -18,9 +18,10 @@ from starlette.responses import StreamingResponse, FileResponse
|
|||||||
|
|
||||||
import pywxdump
|
import pywxdump
|
||||||
from pywxdump import decrypt_merge,get_core_db
|
from pywxdump import decrypt_merge,get_core_db
|
||||||
from pywxdump.db import DBHandler, download_file, dat2img
|
from pywxdump.db import DBHandler
|
||||||
from pywxdump.db.export import export_csv, export_json, export_html
|
from pywxdump.db.utils import download_file, dat2img
|
||||||
|
|
||||||
|
from .export import export_csv, export_json, export_html
|
||||||
from .rjson import ReJson, RqJson
|
from .rjson import ReJson, RqJson
|
||||||
from .utils import error9999, gc, asyncError9999
|
from .utils import error9999, gc, asyncError9999
|
||||||
|
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-#
|
# -*- coding: utf-8 -*-#
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
# Name: __init__.py.py
|
# Name: __init__.py
|
||||||
# Description:
|
# Description: db
|
||||||
# Author: xaoyaoo
|
# Author: xaoyaoo
|
||||||
# Date: 2024/04/15
|
# Date: 2024/04/15
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
# import pandas as pd
|
|
||||||
|
|
||||||
from .utils import download_file, dat2img
|
from .utils import download_file, dat2img
|
||||||
|
|
||||||
from .dbFavorite import FavoriteHandler
|
from .dbFavorite import FavoriteHandler
|
||||||
@ -82,3 +80,7 @@ class DBHandler(MicroHandler, MediaHandler, OpenIMContactHandler, PublicMsgHandl
|
|||||||
count = {k: chat_count.get(k, 0) + chat_count1.get(k, 0) for k in
|
count = {k: chat_count.get(k, 0) + chat_count1.get(k, 0) for k in
|
||||||
list(set(list(chat_count.keys()) + list(chat_count1.keys())))}
|
list(set(list(chat_count.keys()) + list(chat_count1.keys())))}
|
||||||
return count
|
return count
|
||||||
|
|
||||||
|
|
||||||
|
__all__ = ["DBHandler", "FavoriteHandler", "MsgHandler", "MicroHandler", "MediaHandler",
|
||||||
|
"OpenIMContactHandler", "PublicMsgHandler", "OpenIMMediaHandler", "SnsHandler"]
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-#
|
# -*- coding: utf-8 -*-#
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
# Name: __init__.py.py
|
# Name: __init__.py.py
|
||||||
# Description:
|
# Description: db.utils
|
||||||
# Author: xaoyaoo
|
# Author: xaoyaoo
|
||||||
# Date: 2024/07/23
|
# Date: 2024/07/23
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
@ -10,4 +10,4 @@ from .common_utils import timestamp2str, xml2dict, silk2audio, bytes2str, get_md
|
|||||||
type_converter, match_BytesExtra, db_error, download_file, dat2img
|
type_converter, match_BytesExtra, db_error, download_file, dat2img
|
||||||
|
|
||||||
__all__ = ["db_loger", "timestamp2str", "xml2dict", "silk2audio", "bytes2str", "get_md5", "name2typeid", "typeid2name",
|
__all__ = ["db_loger", "timestamp2str", "xml2dict", "silk2audio", "bytes2str", "get_md5", "name2typeid", "typeid2name",
|
||||||
"type_converter", "match_BytesExtra", "db_error", "download_file", "dat2img"]
|
"type_converter", "match_BytesExtra", "db_error", "download_file", "dat2img"]
|
||||||
|
@ -4,17 +4,16 @@ pycryptodomex
|
|||||||
pywin32
|
pywin32
|
||||||
silk-python
|
silk-python
|
||||||
pyaudio
|
pyaudio
|
||||||
pymem
|
|
||||||
psutil
|
|
||||||
requests
|
requests
|
||||||
pillow
|
|
||||||
pyahocorasick
|
pyahocorasick
|
||||||
blackboxprotobuf
|
|
||||||
lz4
|
lz4
|
||||||
|
blackboxprotobuf
|
||||||
lxml
|
lxml
|
||||||
pandas
|
pandas
|
||||||
|
dbutils
|
||||||
|
psutil
|
||||||
|
pymem
|
||||||
|
|
||||||
fastapi
|
fastapi
|
||||||
uvicorn
|
uvicorn
|
||||||
python-dotenv
|
python-dotenv
|
||||||
email-validator
|
|
13
setup.py
13
setup.py
@ -20,10 +20,7 @@ install_requires = [
|
|||||||
"silk-python",
|
"silk-python",
|
||||||
"pyaudio",
|
"pyaudio",
|
||||||
"requests",
|
"requests",
|
||||||
"pillow",
|
|
||||||
"pyahocorasick",
|
"pyahocorasick",
|
||||||
# "flask",
|
|
||||||
# "flask_cors",
|
|
||||||
"lz4",
|
"lz4",
|
||||||
"blackboxprotobuf",
|
"blackboxprotobuf",
|
||||||
"lxml",
|
"lxml",
|
||||||
@ -33,7 +30,8 @@ install_requires = [
|
|||||||
"fastapi",
|
"fastapi",
|
||||||
"uvicorn",
|
"uvicorn",
|
||||||
"python-dotenv",
|
"python-dotenv",
|
||||||
"email-validator"
|
|
||||||
|
# "pillow",
|
||||||
]
|
]
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
@ -48,21 +46,20 @@ setup(
|
|||||||
license='MIT',
|
license='MIT',
|
||||||
|
|
||||||
packages=['pywxdump', 'pywxdump.ui', 'pywxdump.wx_core', 'pywxdump.wx_core.utils', 'pywxdump.analyzer',
|
packages=['pywxdump', 'pywxdump.ui', 'pywxdump.wx_core', 'pywxdump.wx_core.utils', 'pywxdump.analyzer',
|
||||||
'pywxdump.api', 'pywxdump.db', 'pywxdump.db.utils', 'pywxdump.db.export'],
|
'pywxdump.api', 'pywxdump.api.export', 'pywxdump.db', 'pywxdump.db.utils'],
|
||||||
package_dir={'pywxdump': 'pywxdump',
|
package_dir={'pywxdump': 'pywxdump',
|
||||||
'pywxdump.wx_core': 'pywxdump/wx_core',
|
'pywxdump.wx_core': 'pywxdump/wx_core',
|
||||||
'pywxdump.wx_core.utils': 'pywxdump/wx_core/utils',
|
'pywxdump.wx_core.utils': 'pywxdump/wx_core/utils',
|
||||||
'pywxdump.analyzer': 'pywxdump/analyzer',
|
'pywxdump.analyzer': 'pywxdump/analyzer',
|
||||||
'pywxdump.ui': 'pywxdump/ui',
|
'pywxdump.ui': 'pywxdump/ui',
|
||||||
'pywxdump.api': 'pywxdump/api',
|
'pywxdump.api': 'pywxdump/api',
|
||||||
|
'pywxdump.api.export': 'pywxdump/api/export',
|
||||||
'pywxdump.db': 'pywxdump/db',
|
'pywxdump.db': 'pywxdump/db',
|
||||||
'pywxdump.db.utils': 'pywxdump/db/utils',
|
'pywxdump.db.utils': 'pywxdump/db/utils'
|
||||||
'pywxdump.db.export': 'pywxdump/db/export'
|
|
||||||
},
|
},
|
||||||
|
|
||||||
package_data={
|
package_data={
|
||||||
'pywxdump': ['WX_OFFS.json', 'ui/web/*', 'ui/web/assets/*', 'wx_core/tools/*',
|
'pywxdump': ['WX_OFFS.json', 'ui/web/*', 'ui/web/assets/*', 'wx_core/tools/*',
|
||||||
"ui/export/*", "ui/export/assets/*", "ui/export/assets/css/*", "ui/export/assets/js/*",
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
classifiers=[
|
classifiers=[
|
||||||
|
@ -16,6 +16,7 @@ ma_version = __version__.split(".")[0]
|
|||||||
mi_version = __version__.split(".")[1]
|
mi_version = __version__.split(".")[1]
|
||||||
pa_version = __version__.split(".")[2]
|
pa_version = __version__.split(".")[2]
|
||||||
|
|
||||||
|
|
||||||
def image_to_base64(image_path):
|
def image_to_base64(image_path):
|
||||||
with open(image_path, "rb") as image_file:
|
with open(image_path, "rb") as image_file:
|
||||||
encoded_string = base64.b64encode(image_file.read())
|
encoded_string = base64.b64encode(image_file.read())
|
||||||
@ -38,7 +39,7 @@ spec_content = '''
|
|||||||
|
|
||||||
block_cipher = None
|
block_cipher = None
|
||||||
|
|
||||||
a = Analysis(['tmp.py'],
|
a = Analysis(['wxdump.py'],
|
||||||
pathex=[],
|
pathex=[],
|
||||||
binaries=[],
|
binaries=[],
|
||||||
datas=[(r'{root_path}\\WX_OFFS.json', 'pywxdump'),
|
datas=[(r'{root_path}\\WX_OFFS.json', 'pywxdump'),
|
||||||
@ -129,11 +130,10 @@ VSVersionInfo(
|
|||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
# 创建文件夹
|
# 创建文件夹
|
||||||
os.makedirs("dist", exist_ok=True)
|
os.makedirs("dist", exist_ok=True)
|
||||||
# 将代码写入文件
|
# 将代码写入文件
|
||||||
with open("dist/tmp.py", "w", encoding="utf-8") as f:
|
with open("dist/wxdump.py", "w", encoding="utf-8") as f:
|
||||||
f.write(code.strip())
|
f.write(code.strip())
|
||||||
|
|
||||||
current_path = os.path.dirname(os.path.abspath(__file__))
|
current_path = os.path.dirname(os.path.abspath(__file__))
|
||||||
@ -142,7 +142,6 @@ shutil.copy(os.path.join(current_path, "favicon.ico"), "dist/icon.ico") # 复
|
|||||||
with open("dist/wxdump_version_info.txt", "w", encoding="utf-8") as f:
|
with open("dist/wxdump_version_info.txt", "w", encoding="utf-8") as f:
|
||||||
f.write(wxdump_version_info.strip())
|
f.write(wxdump_version_info.strip())
|
||||||
|
|
||||||
|
|
||||||
# 获取安装包的路径
|
# 获取安装包的路径
|
||||||
package_path = site.getsitepackages()
|
package_path = site.getsitepackages()
|
||||||
if package_path:
|
if package_path:
|
||||||
@ -152,27 +151,31 @@ if package_path:
|
|||||||
require_path = os.path.join(os.path.dirname(current_path), "requirements.txt") # requirements.txt 路径
|
require_path = os.path.join(os.path.dirname(current_path), "requirements.txt") # requirements.txt 路径
|
||||||
with open(require_path, "r", encoding="utf-8") as f:
|
with open(require_path, "r", encoding="utf-8") as f:
|
||||||
hidden_imports = f.read().splitlines()
|
hidden_imports = f.read().splitlines()
|
||||||
hidden_imports = [i.replace('-','_') for i in hidden_imports if i not in ["setuptools", "wheel"]] # 去掉setuptools、wheel
|
hidden_imports = [i.replace('-', '_') for i in hidden_imports if
|
||||||
|
i and i not in ["setuptools", "wheel"]] # 去掉setuptools、wheel
|
||||||
|
hidden_imports += ["pywxdump", "pywxdump.db","pywxdump.db.__init__.utils"]
|
||||||
|
|
||||||
# 获取 ui 文件夹下的所有文件 用于打包
|
# 获取 ui 文件夹下的所有文件 用于打包
|
||||||
root_path = os.path.join(package_path, 'pywxdump')
|
root_path = os.path.join(package_path, 'pywxdump')
|
||||||
datas_741258 = []
|
datas_741258 = []
|
||||||
for root, dirs, files in os.walk(os.path.join(root_path, "ui")):
|
for root, dirs, files in os.walk(root_path):
|
||||||
for file in files:
|
for file in files:
|
||||||
file_path = os.path.join(root, file)
|
file_path = os.path.join(root, file)
|
||||||
datas_741258.append(f'''(r'{file_path}', r'{os.path.dirname(file_path.replace(package_path, "")[1:])}' )''')
|
if "__pycache__" in file_path:
|
||||||
|
continue
|
||||||
|
datas_741258.append(f'''(r'{file_path}', r'{os.path.dirname(file_path.replace(package_path, "")[1:])}')''')
|
||||||
datas_741258 = ",\n".join(datas_741258)
|
datas_741258 = ",\n".join(datas_741258)
|
||||||
|
|
||||||
# 获取 wx_core/tools 文件夹下的所有文件 用于打包
|
# # 获取 wx_core/tools 文件夹下的所有文件 用于打包
|
||||||
for root, dirs, files in os.walk(os.path.join(root_path, "wx_core", "tools")):
|
# for root, dirs, files in os.walk(os.path.join(root_path, "wx_core", "tools")):
|
||||||
for file in files:
|
# for file in files:
|
||||||
file_path = os.path.join(root, file)
|
# file_path = os.path.join(root, file)
|
||||||
datas_741258 += f''',\n(r'{file_path}', r'{os.path.dirname(file_path.replace(package_path, "")[1:])}' )'''
|
# datas_741258 += f''',\n(r'{file_path}', r'{os.path.dirname(file_path.replace(package_path, "")[1:])}' )'''
|
||||||
|
|
||||||
|
|
||||||
# print(datas_741258)
|
# print(datas_741258)
|
||||||
# 生成 spec 文件
|
# 生成 spec 文件
|
||||||
spec_content = spec_content.format(root_path=root_path, hidden_imports=hidden_imports, datas_741258=datas_741258, version=__version__)
|
spec_content = spec_content.format(root_path=root_path, hidden_imports=hidden_imports, datas_741258=datas_741258,
|
||||||
|
version=__version__)
|
||||||
spec_file = os.path.join("dist", "pywxdump.spec")
|
spec_file = os.path.join("dist", "pywxdump.spec")
|
||||||
with open(spec_file, 'w', encoding="utf-8") as f:
|
with open(spec_file, 'w', encoding="utf-8") as f:
|
||||||
f.write(spec_content.strip())
|
f.write(spec_content.strip())
|
||||||
|
Loading…
Reference in New Issue
Block a user