Skip to content

Commit fd24dc5

Browse files
committed
.spec file: using hooks (simplified)
1 parent 6f28501 commit fd24dc5

File tree

1 file changed

+4
-20
lines changed

1 file changed

+4
-20
lines changed

DataLab.spec

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,16 @@
33
# Initial command:
44
# pyinstaller -y --clean -n DataLab -i resources\DataLab.ico cdl\start.pyw
55

6-
import os.path as osp
7-
import guidata
8-
guidata_path = osp.dirname(guidata.__file__)
9-
guidata_images = osp.join(guidata_path, 'images')
10-
guidata_locale = osp.join(guidata_path, 'locale', 'fr', 'LC_MESSAGES')
11-
import plotpy
12-
plotpy_path = osp.dirname(plotpy.__file__)
13-
plotpy_images = osp.join(plotpy_path, 'images')
14-
plotpy_locale = osp.join(plotpy_path, 'locale', 'fr', 'LC_MESSAGES')
15-
16-
from PyInstaller.utils.hooks import collect_submodules
6+
from PyInstaller.utils.hooks import collect_submodules, collect_data_files
177
all_hidden_imports = collect_submodules('cdl')
8+
datas = collect_data_files('cdl') + [('cdl\\plugins', 'cdl\\plugins')]
9+
datas += collect_data_files('guidata') + collect_data_files('plotpy')
1810

1911
a = Analysis(
2012
['cdl\\start.pyw'],
2113
pathex=[],
2214
binaries=[],
23-
datas=[
24-
(guidata_images, 'guidata\\images'),
25-
(guidata_locale, 'guidata\\locale\\fr\\LC_MESSAGES'),
26-
(plotpy_images, 'plotpy\\images'),
27-
(plotpy_locale, 'plotpy\\locale\\fr\\LC_MESSAGES'),
28-
('cdl\\plugins', 'cdl\\plugins'),
29-
('cdl\\data', 'cdl\\data'),
30-
('cdl\\locale\\fr\\LC_MESSAGES\\cdl.mo', 'cdl\\locale\\fr\\LC_MESSAGES'),
31-
],
15+
datas=datas,
3216
hiddenimports=all_hidden_imports,
3317
hookspath=[],
3418
hooksconfig={},

0 commit comments

Comments
 (0)