-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCompressImage.spec
More file actions
85 lines (73 loc) · 1.79 KB
/
CompressImage.spec
File metadata and controls
85 lines (73 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# -*- mode: python ; coding: utf-8 -*-
from pathlib import Path
from PyInstaller.utils.hooks import collect_data_files, collect_submodules
project_dir = Path(SPECPATH)
icon_path = project_dir / "assets" / "CompressImage.icns"
icon_png_path = project_dir / "icon.png"
bundle_icon = str(icon_path) if icon_path.exists() else None
datas = collect_data_files("tkinterdnd2")
if icon_png_path.exists():
datas.append((str(icon_png_path), "."))
hiddenimports = (
collect_submodules("tkinterdnd2")
+ collect_submodules("cffi")
+ ["_cffi_backend", "imagequant._libimagequant"]
)
app_name = "CompressImage"
bundle_identifier = "com.local.compressimage"
info_plist = {
"CFBundleName": app_name,
"CFBundleDisplayName": "压缩工具箱 Pro",
"CFBundleShortVersionString": "1.0.0",
"CFBundleVersion": "1",
"NSHighResolutionCapable": True,
}
if bundle_icon is not None:
info_plist["CFBundleIconFile"] = Path(bundle_icon).name
a = Analysis(
["app.py"],
pathex=[str(project_dir)],
binaries=[],
datas=datas,
hiddenimports=hiddenimports,
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name=app_name,
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=False,
console=False,
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=False,
upx_exclude=[],
name=app_name,
)
app = BUNDLE(
coll,
name=f"{app_name}.app",
icon=bundle_icon,
bundle_identifier=bundle_identifier,
info_plist=info_plist,
)