From d397c7bbe20273a147fd17cda3bb0d9ad72bc6c4 Mon Sep 17 00:00:00 2001 From: SikongJueluo Date: Wed, 10 Jul 2024 21:22:25 +0800 Subject: [PATCH] add spec file --- .gitignore | 4 +++- ISPController.spec | 44 ++++++++++++++++++++++++++++++++++++++++++++ requirements.txt | 3 +++ src/main.py | 1 + 4 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 ISPController.spec diff --git a/.gitignore b/.gitignore index c464545..6bd83dc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ .venv/ -src/__pycache__/ \ No newline at end of file +src/__pycache__/ +build/ +dist/ \ No newline at end of file diff --git a/ISPController.spec b/ISPController.spec new file mode 100644 index 0000000..da451a9 --- /dev/null +++ b/ISPController.spec @@ -0,0 +1,44 @@ +# -*- mode: python ; coding: utf-8 -*- + + +a = Analysis( + ['src/main.py'], + pathex=['src'], + binaries=[], + datas=[], + hiddenimports=['tkinter','PIL','PIL._tkinter_finder'], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + noarchive=False, + optimize=0, +) +pyz = PYZ(a.pure) + +exe = EXE( + pyz, + a.scripts, + [], + exclude_binaries=True, + name='ISPController', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + console=True, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, +) +coll = COLLECT( + exe, + a.binaries, + a.datas, + strip=False, + upx=True, + upx_exclude=[], + name='ISPController', +) diff --git a/requirements.txt b/requirements.txt index 8cabfc2..4bf246b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ +altgraph==0.17.4 CTkMessagebox==2.7 customtkinter==5.2.2 darkdetect==0.8.0 @@ -5,6 +6,8 @@ future==1.0.0 iso8601==2.1.0 packaging==24.1 pillow==10.4.0 +pyinstaller==6.9.0 +pyinstaller-hooks-contrib==2024.7 pyserial==3.5 PyYAML==6.0.1 serial==0.0.97 diff --git a/src/main.py b/src/main.py index 0a3b209..f70eb7c 100644 --- a/src/main.py +++ b/src/main.py @@ -328,6 +328,7 @@ class App(ctk.CTk): self.serial.write(bytes.encode()) else: print("Please Connect to Serial") + messagebox.showError("Please Connect Serial Port") def run(self): self.mainloop()