修改图标路径

This commit is contained in:
shuaikangzhou 2024-01-03 21:48:41 +08:00
parent 5b4fe8b8e1
commit e9cc4b0788
4 changed files with 26 additions and 7 deletions

View File

@ -85,16 +85,22 @@ class MediaMsg:
# # 调用 FFmpeg
if os.path.exists(ffmpeg_path):
cmd = f'''{ffmpeg_path} -loglevel quiet -y -f s16le -i {pcm_path} -ar 44100 -ac 1 {mp3_path}'''
system(cmd)
# system(cmd)
# 使用subprocess.run()执行命令
subprocess.run(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
else:
# 源码运行的时候下面的有效
# 这里不知道怎么捕捉异常
cmd = f'''{os.path.join(os.getcwd(), 'app', 'resources', 'data','ffmpeg.exe')} -loglevel quiet -y -f s16le -i {pcm_path} -ar 44100 -ac 1 {mp3_path}'''
system(cmd)
# system(cmd)
# 使用subprocess.run()执行命令
subprocess.run(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
except Exception as e:
print(f"Error: {e}")
cmd = f'''{os.path.join(os.getcwd(), 'app', 'resources', 'data', 'ffmpeg.exe')} -loglevel quiet -y -f s16le -i {pcm_path} -ar 44100 -ac 1 {mp3_path}'''
system(cmd)
# system(cmd)
# 使用subprocess.run()执行命令
subprocess.run(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
os.remove(silk_path)
os.remove(pcm_path)
print(mp3_path)

View File

@ -53,6 +53,11 @@ def makedirs(path):
os.makedirs(os.path.join(path, 'music'), exist_ok=True)
os.makedirs(os.path.join(path, 'icon'), exist_ok=True)
resource_dir = os.path.join('app', 'resources', 'data', 'icons')
if not os.path.exists(resource_dir):
# 获取打包后的资源目录
resource_dir = getattr(sys, '_MEIPASS', os.path.abspath(os.path.dirname(__file__)))
# 构建 FFmpeg 可执行文件的路径
resource_dir = os.path.join(resource_dir, 'app', 'resources', 'data', 'icons')
target_folder = os.path.join(path, 'icon')
# 拷贝一些必备的图标
for root, dirs, files in os.walk(resource_dir):

View File

@ -1,14 +1,15 @@
version = '1.0.1'
version = '1.0.2'
contact = '701805520'
github = 'https://github.com/LC044/WeChatMsg'
website = 'https://memotrace.lc044.love/'
copyright = '©2022-2023 ShuaikangZhou'
copyright = '© 2022-2024 SiYuan'
license = 'GPLv3'
description = [
'1. 支持获取个人信息<br>',
'2. 支持显示聊天界面<br>',
'3. 支持导出聊天记录<br>&nbsp;&nbsp;&nbsp;&nbsp;* csv<br>&nbsp;&nbsp;&nbsp;&nbsp;* html<br>&nbsp;&nbsp;&nbsp;&nbsp;* '
'txt<br>',
'4. 生成年度报告——圣诞特别版<br>',
'txt<br>&nbsp;&nbsp;&nbsp;&nbsp;* docx<br>',
'4. 生成年度报告——圣诞特别版',
]
about = f'''
版本{version}<br>
@ -16,5 +17,6 @@ about = f'''
地址<a href='{github}'>{github}</a><br>
官网<a href='{website}'>{website}</a><br>
新特性:<br>{''.join(['' + i for i in description])}<br>
License <a href='https://github.com/LC044/WeChatMsg/blob/master/LICENSE'>{license}</a><br>
Copyright {copyright}
'''

View File

@ -308,3 +308,9 @@ python main.py
<img src="./doc/images/weixin.png">
<img src="./doc/images/qq.jpg" height="200">
</div>
## License
WeChatMsg is licensed under [GPLv3](./LICENSE).
Copyright © 2022-2024 by SiYuan.