-
Notifications
You must be signed in to change notification settings - Fork 0
/
LVSconnect.spec
53 lines (37 loc) · 1.31 KB
/
LVSconnect.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
# -*- mode: python ; coding: utf-8 -*-
'''
This .spec file creates multiple executables in a single directory, so
that they all share the same libraries and files.
The variable project_name will be used for that single directory; the
names in sub_names should each have a .spec file in the current
directory (created beforehand with the pyi-makespec program).
It works by running all sub .spec files, but intercepting the COLLECT
function. After that, a single COLLECT call is made using all the args
for the intercepted calls.
This is a generalisation of the method described in
https://www.zacoding.com/en/post/pyinstaller-create-multiple-executables.
'''
# Customize this
project_name= "LVSconnect"
sub_names= ["lvs_attendance", "lvs_find_free_room", "lvs_send_grades", "lvs_send_appreciations"]
block_cipher = None
all_collect_args= []
for name in sub_names:
with open(name + ".spec") as f:
spec_content= f.read()
def replaced_collect(*args, **kwargs):
global collect_args
collect_args= args
l= locals().copy()
g= globals().copy()
g["COLLECT"]= replaced_collect
l["COLLECT"]= replaced_collect
exec(spec_content, g, l)
all_collect_args+= collect_args
coll= COLLECT(
*all_collect_args,
strip=False,
upx=True,
upx_exclude=[],
name= project_name
)