forked from elliottzheng/NotebookLM2PPT
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompile.py
More file actions
36 lines (27 loc) · 1.09 KB
/
compile.py
File metadata and controls
36 lines (27 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import toml
import os
import argparse
# pyinstaller --clean -F -w -n notebooklm2ppt_{version} --optimize=2 --collect-all spire.presentation main.py
if __name__ == "__main__":
# 读取toml中的版本号
# 执行编译命令
parser = argparse.ArgumentParser(description="Compile notebooklm2ppt into a standalone executable.")
parser.add_argument(
"--as_dir",
action="store_true",
help="Compile as a directory instead of a single file executable.",
)
args = parser.parse_args()
with open("pyproject.toml", "r", encoding="utf-8") as f:
pyproject_data = toml.load(f)
version = pyproject_data["project"]["version"]
output_name = f"notebooklm2ppt-{version}"
print(f"编译版本: {output_name}")
os.system('del *.spec')
if not args.as_dir:
flags = "-F"
else:
flags = "-D"
icon_path = "docs/public/favicon.ico"
command = f'pyinstaller --clean {flags} -w --icon {icon_path} --add-data "{icon_path};." -n {output_name} --optimize=2 --collect-all spire.presentation main.py'
os.system(command)