-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup-py2exe.py
72 lines (60 loc) · 1.74 KB
/
setup-py2exe.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
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
#!/usr/bin/env python
#-*- coding:utf-8 -*-
"""
This file is part of OpenSesame.
Datamerger is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Datamerger is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenSesame. If not, see <http://www.gnu.org/licenses/>.
This scripts builds OpenSesame as a standalone application for Mac OS.
Usage:
python setup.py py2app
"""
from distutils.core import setup
import py2exe
import os
import shutil
SCRIPT_NAME = "datamerger"
# Clean up previous builds
try:
shutil.rmtree("dist")
except:
pass
try:
shutil.rmtree("build")
except:
pass
# Add resources folder (containing images and such)
print os.listdir('resources')
Mydata_files = []
for files in os.listdir('resources'):
f1 = os.path.join('resources', files)
if os.path.isfile(f1) or os.path.splitext(f1) == ".db": # skip directories
f2 = 'resources', [f1]
Mydata_files.append(f2)
# Build!
setup(
windows = [
{
'script': SCRIPT_NAME,
'icon_resources' : [(1,'resources\\datamerger.ico')],
}
],
data_files = Mydata_files,
options = {'py2exe' :
{
"compressed" : True,
"optimize": 2,
"bundle_files": 3,
'includes' : ['sip','PyQt4.QtCore','PyQt4.QtGui','PyQt4.QtWebKit','PyQt4.QtNetwork' ],
'excludes' : ['wx','numpy','Image','PIL'],
"dll_excludes" : ["MSVCP90.DLL","libzmq.dll","icuuc50.dll"],
}
}
)