Răsfoiți Sursa

目录形式的打包策略

DESKTOP-53URE31\USER 4 luni în urmă
părinte
comite
5198390c18
1 a modificat fișierele cu 61 adăugiri și 0 ștergeri
  1. 61 0
      maindir.spec

+ 61 - 0
maindir.spec

@@ -0,0 +1,61 @@
+# -*- mode: python ; coding: utf-8 -*-
+
+
+a = Analysis(
+    ['main.py'],
+    pathex=[],
+    binaries=[('config.json','config.json')],
+    datas=[('wcferry', 'wcferry'),('template.db', '.')],
+    hiddenimports=['_cffi_backend'],
+    hookspath=[],
+    hooksconfig={},
+    runtime_hooks=[],
+    excludes=[],
+    noarchive=False,
+    optimize=0,
+)
+pyz = PYZ(a.pure)
+
+exe = EXE(
+    pyz,
+    a.scripts,
+    [],
+    exclude_binaries=True,
+    name='轻马AI智能助手',
+    debug=False,
+    bootloader_ignore_signals=False,
+    strip=False,
+    upx=True,
+    console=False,
+    disable_windowed_traceback=False,
+    argv_emulation=False,
+    target_arch=None,
+    codesign_identity=None,
+    entitlements_file=None,
+    icon=['wechat.ico'],
+)
+coll = COLLECT(
+    exe,
+    a.binaries,
+    a.datas,
+    strip=False,
+    upx=True,
+    upx_exclude=[],
+    name='轻马AI智能助手',
+)
+
+import shutil
+import os
+
+def create_logs_directory():
+    logs_path = os.path.join('dist/轻马AI智能助手','logs')
+    if not os.path.exists(logs_path):
+        os.makedirs(logs_path)
+
+def copy_file():
+    shutil.copy("./config.json", "./dist/轻马AI智能助手/config.json")
+
+# Call the function to create the logs directory
+create_logs_directory()
+
+copy_file()