-
Notifications
You must be signed in to change notification settings - Fork 1
/
mac.spec
82 lines (72 loc) · 2.4 KB
/
mac.spec
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
# -*- mode: python -*-
import os
import sys
def collect_submodules(name):
result = [name]
path = os.path.join(*name.split("."))
for sub_dir in os.listdir(path):
if os.path.exists(os.path.join(path, sub_dir, "__init__.py")):
sub_name = name + "." + sub_dir
result += collect_submodules(sub_name)
elif sub_dir[-3:] == ".py" and sub_dir != "__init__.py":
result.append(name + "." + sub_dir[:-3])
return result
def exclude_init_files(path):
result = []
has_file = False
for sub_dir in os.listdir(path):
if sub_dir in ["__init__.py", "__pycache__"]:
continue
sub_path = os.path.join(path, sub_dir)
if os.path.isdir(sub_path):
result += exclude_init_files(sub_path)
elif not has_file and os.path.isfile(sub_path):
result.append((sub_path, path))
has_file = True
return result
block_cipher = None
a = Analysis([os.path.join(os.getcwd(), "main_gui.py")],
pathex=[os.getcwd()],
binaries=[],
datas=[
("templates", "templates"),
("version.txt", "."),
*exclude_init_files("sites"),
(os.path.join("gui", "assets"), os.path.join("gui", "assets")),
(os.path.join("core", "assets"), os.path.join("core", "assets")),
],
hiddenimports=["encodings.idna", "babel.numbers"] + collect_submodules("sites"),
hookspath=[],
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)
exe = EXE(pyz,
a.scripts,
[],
exclude_binaries=True,
name='ethz-document-fetcher',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=False )
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='mac')
app = BUNDLE(coll,
name='ethz-document-fetcher.app',
icon=os.path.join("gui", "assets", "logo", "logo.icns"),
bundle_identifier=None,
info_plist={
'NSHighResolutionCapable': 'True'
})