-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexport.py
32 lines (22 loc) · 968 Bytes
/
export.py
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
import PyInstaller.__main__
import os
NAME = 'FreeFlowLearning'
BUILD_DIR = os.path.join(os.getcwd(), 'build')
DIST_PATH = os.path.join(os.getcwd(), 'binaries')
resource_args = [
*['--add-binary=%s:.' % os.path.join(NAME, 'Frontend','static', 'img', file) for file in os.listdir(os.path.join(NAME, 'Frontend','static', 'img'))],
*['--add-data=%s:.' % os.path.join(NAME, 'Frontend','static', 'js', file) for file in os.listdir(os.path.join(NAME, 'Frontend', 'static', 'js'))],
*['--add-data=%s:.' % os.path.join(NAME, 'Frontend','templates', file) for file in os.listdir(os.path.join(NAME, 'Frontend','templates'))]
]
PyInstaller.__main__.run([
'--name=%s' % NAME,
'--onefile',
'--log-level=CRITICAL',
'--distpath=%s' % DIST_PATH,
'--specpath=%s' % os.getcwd(),
'--workpath=%s' % BUILD_DIR,
*resource_args,
os.path.join(NAME, '__main__.py'),
])
os.system('rm -rf %s' % BUILD_DIR)
os.remove('%s.spec' % NAME)