maindir.spec 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # -*- mode: python ; coding: utf-8 -*-
  2. a = Analysis(
  3. ['main.py'],
  4. pathex=[],
  5. binaries=[('config.json','config.json')],
  6. datas=[('wcferry', 'wcferry'),('template.db', '.')],
  7. hiddenimports=['_cffi_backend'],
  8. hookspath=[],
  9. hooksconfig={},
  10. runtime_hooks=[],
  11. excludes=[],
  12. noarchive=False,
  13. optimize=0,
  14. )
  15. pyz = PYZ(a.pure)
  16. exe = EXE(
  17. pyz,
  18. a.scripts,
  19. [],
  20. exclude_binaries=True,
  21. name='轻马AI智能助手',
  22. debug=False,
  23. bootloader_ignore_signals=False,
  24. strip=False,
  25. upx=True,
  26. console=False,
  27. disable_windowed_traceback=False,
  28. argv_emulation=False,
  29. target_arch=None,
  30. codesign_identity=None,
  31. entitlements_file=None,
  32. icon=['wechat.ico'],
  33. )
  34. coll = COLLECT(
  35. exe,
  36. a.binaries,
  37. a.datas,
  38. strip=False,
  39. upx=True,
  40. upx_exclude=[],
  41. name='轻马AI智能助手',
  42. )
  43. import shutil
  44. import os
  45. def create_logs_directory():
  46. logs_path = os.path.join('dist/轻马AI智能助手','logs')
  47. if not os.path.exists(logs_path):
  48. os.makedirs(logs_path)
  49. def copy_file():
  50. shutil.copy("./config.json", "./dist/轻马AI智能助手/config.json")
  51. # Call the function to create the logs directory
  52. create_logs_directory()
  53. copy_file()