feat: Add new files for i18n, libs, and project structure

This commit is contained in:
tukuaiai
2025-12-18 13:33:30 +08:00
parent 516ac26f93
commit bfa0694868
750 changed files with 112255 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
#!/usr/bin/env python3
"""打包脚本 - 生成独立可执行文件"""
import subprocess
import sys
import os
import shutil
def main():
os.chdir(os.path.dirname(os.path.abspath(__file__)))
for d in ['build', 'dist']:
if os.path.exists(d):
shutil.rmtree(d)
print("开始打包...")
sep = ";" if sys.platform == "win32" else ":"
cmd = [
sys.executable, "-m", "PyInstaller",
"--onefile",
"--name", "ai-chat-converter",
f"--add-data=src{sep}src",
"--hidden-import", "tiktoken_ext.openai_public",
"--hidden-import", "tiktoken_ext",
"--hidden-import", "dotenv",
"--collect-data", "tiktoken",
"--collect-all", "watchdog",
"--collect-all", "dotenv",
"src/main.py"
]
subprocess.run(cmd, check=True)
exe = "dist/ai-chat-converter.exe" if sys.platform == "win32" else "dist/ai-chat-converter"
size = os.path.getsize(exe) / 1024 / 1024
print(f"\n✓ 打包完成: {exe} ({size:.1f} MB)")
if __name__ == "__main__":
main()