mirror of
https://github.com/xfgryujk/blivechat.git
synced 2024-12-26 04:41:40 +08:00
添加插件打包脚本
This commit is contained in:
parent
c9b713fa85
commit
b2b60955e0
21
plugins/msg-logging/LICENSE
Normal file
21
plugins/msg-logging/LICENSE
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2024 xfgryujk
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
84
plugins/msg-logging/msg-logging.spec
Normal file
84
plugins/msg-logging/msg-logging.spec
Normal file
@ -0,0 +1,84 @@
|
||||
# -*- mode: python ; coding: utf-8 -*-
|
||||
import typing
|
||||
import subprocess
|
||||
import sys
|
||||
if typing.TYPE_CHECKING:
|
||||
import os
|
||||
|
||||
from PyInstaller.building.api import COLLECT, EXE, PYZ
|
||||
from PyInstaller.building.build_main import Analysis
|
||||
|
||||
SPECPATH = ''
|
||||
DISTPATH = ''
|
||||
|
||||
|
||||
# exe文件名、打包目录名
|
||||
NAME = 'msg-logging'
|
||||
# 模块搜索路径
|
||||
PYTHONPATH = [
|
||||
os.path.join(SPECPATH, '..', '..'), # 为了找到blcsdk
|
||||
]
|
||||
# 数据
|
||||
DATAS = [
|
||||
('plugin.json', '.'),
|
||||
('LICENSE', '.'),
|
||||
('log/.gitkeep', 'log'),
|
||||
]
|
||||
|
||||
block_cipher = None
|
||||
|
||||
|
||||
a = Analysis(
|
||||
['main.py'],
|
||||
pathex=PYTHONPATH,
|
||||
binaries=[],
|
||||
datas=DATAS,
|
||||
hiddenimports=[],
|
||||
hookspath=[],
|
||||
hooksconfig={},
|
||||
runtime_hooks=[],
|
||||
excludes=[],
|
||||
win_no_prefer_redirects=False,
|
||||
win_private_assemblies=False,
|
||||
cipher=block_cipher,
|
||||
noarchive=False,
|
||||
)
|
||||
|
||||
pyz = PYZ(
|
||||
a.pure,
|
||||
a.zipped_data,
|
||||
cipher=block_cipher,
|
||||
)
|
||||
|
||||
exe = EXE(
|
||||
pyz,
|
||||
a.scripts,
|
||||
[],
|
||||
exclude_binaries=True,
|
||||
name=NAME,
|
||||
debug=False,
|
||||
bootloader_ignore_signals=False,
|
||||
strip=False,
|
||||
upx=False,
|
||||
console=True,
|
||||
disable_windowed_traceback=False,
|
||||
argv_emulation=False,
|
||||
target_arch=None,
|
||||
codesign_identity=None,
|
||||
entitlements_file=None,
|
||||
)
|
||||
|
||||
coll = COLLECT(
|
||||
exe,
|
||||
a.binaries,
|
||||
a.zipfiles,
|
||||
a.datas,
|
||||
strip=False,
|
||||
upx=False,
|
||||
upx_exclude=[],
|
||||
name=NAME,
|
||||
)
|
||||
|
||||
# 打包
|
||||
print('Start to package')
|
||||
subprocess.run([sys.executable, '-m', 'zipfile', '-c', NAME + '.zip', NAME], cwd=DISTPATH)
|
8
plugins/msg-logging/plugin.json
Normal file
8
plugins/msg-logging/plugin.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "消息日志",
|
||||
"version": "1.0.0",
|
||||
"author": "xfgryujk",
|
||||
"description": "把收到的消息记录到文件中",
|
||||
"run": "msg-logging.exe",
|
||||
"enabled": true
|
||||
}
|
21
plugins/text-to-speech/LICENSE
Normal file
21
plugins/text-to-speech/LICENSE
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2024 xfgryujk
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
8
plugins/text-to-speech/plugin.json
Normal file
8
plugins/text-to-speech/plugin.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "文字转语音",
|
||||
"version": "1.0.0",
|
||||
"author": "xfgryujk",
|
||||
"description": "用语音读出收到的消息",
|
||||
"run": "text-to-speech.exe",
|
||||
"enabled": true
|
||||
}
|
85
plugins/text-to-speech/text-to-speech.spec
Normal file
85
plugins/text-to-speech/text-to-speech.spec
Normal file
@ -0,0 +1,85 @@
|
||||
# -*- mode: python ; coding: utf-8 -*-
|
||||
import typing
|
||||
import subprocess
|
||||
import sys
|
||||
if typing.TYPE_CHECKING:
|
||||
import os
|
||||
|
||||
from PyInstaller.building.api import COLLECT, EXE, PYZ
|
||||
from PyInstaller.building.build_main import Analysis
|
||||
|
||||
SPECPATH = ''
|
||||
DISTPATH = ''
|
||||
|
||||
|
||||
# exe文件名、打包目录名
|
||||
NAME = 'text-to-speech'
|
||||
# 模块搜索路径
|
||||
PYTHONPATH = [
|
||||
os.path.join(SPECPATH, '..', '..'), # 为了找到blcsdk
|
||||
]
|
||||
# 数据
|
||||
DATAS = [
|
||||
('plugin.json', '.'),
|
||||
('LICENSE', '.'),
|
||||
('data/config.example.ini', 'data'),
|
||||
('log/.gitkeep', 'log'),
|
||||
]
|
||||
|
||||
block_cipher = None
|
||||
|
||||
|
||||
a = Analysis(
|
||||
['main.py'],
|
||||
pathex=PYTHONPATH,
|
||||
binaries=[],
|
||||
datas=DATAS,
|
||||
hiddenimports=[],
|
||||
hookspath=[],
|
||||
hooksconfig={},
|
||||
runtime_hooks=[],
|
||||
excludes=[],
|
||||
win_no_prefer_redirects=False,
|
||||
win_private_assemblies=False,
|
||||
cipher=block_cipher,
|
||||
noarchive=False,
|
||||
)
|
||||
|
||||
pyz = PYZ(
|
||||
a.pure,
|
||||
a.zipped_data,
|
||||
cipher=block_cipher,
|
||||
)
|
||||
|
||||
exe = EXE(
|
||||
pyz,
|
||||
a.scripts,
|
||||
[],
|
||||
exclude_binaries=True,
|
||||
name=NAME,
|
||||
debug=False,
|
||||
bootloader_ignore_signals=False,
|
||||
strip=False,
|
||||
upx=False,
|
||||
console=True,
|
||||
disable_windowed_traceback=False,
|
||||
argv_emulation=False,
|
||||
target_arch=None,
|
||||
codesign_identity=None,
|
||||
entitlements_file=None,
|
||||
)
|
||||
|
||||
coll = COLLECT(
|
||||
exe,
|
||||
a.binaries,
|
||||
a.zipfiles,
|
||||
a.datas,
|
||||
strip=False,
|
||||
upx=False,
|
||||
upx_exclude=[],
|
||||
name=NAME,
|
||||
)
|
||||
|
||||
# 打包
|
||||
print('Start to package')
|
||||
subprocess.run([sys.executable, '-m', 'zipfile', '-c', NAME + '.zip', NAME], cwd=DISTPATH)
|
Loading…
Reference in New Issue
Block a user