# -*- mode: python ; coding: utf-8 -*- import os block_cipher = None project_root = ( os.path.abspath(os.path.dirname(__file__)) if "__file__" in globals() else os.path.abspath(os.getcwd()) ) def require_data_dir(rel_path): abs_path = os.path.join(project_root, rel_path) if not os.path.exists(abs_path): raise SystemExit( f"Missing required folder: {abs_path}. " f"Copy the '{rel_path}' folder next to app.py and this spec file." ) return (abs_path, rel_path) datas = [ require_data_dir("templates"), require_data_dir("static"), require_data_dir("picture"), ] a = Analysis( ["app.py"], pathex=[project_root], binaries=[], datas=datas, hiddenimports=[], hookspath=[], hooksconfig={}, runtime_hooks=[], excludes=[], win_no_prefer_redirects=False, win_private_assemblies=False, cipher=block_cipher, noarchive=False, ) pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) # One-file build: no COLLECT step is used. exe = EXE( pyz, a.scripts, a.binaries, a.zipfiles, a.datas, [], name="inventory_app", 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, )