forked from donovan-h-parks/STAMP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setupWindows.py
87 lines (78 loc) · 3.05 KB
/
setupWindows.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
from distutils.core import setup
import py2exe
import os
import matplotlib as mpl
# delete all pyc files
for dirpath, dirnames, filenames in os.walk(os.getcwd()):
for each_file in filenames:
if each_file.endswith('.pyc'):
if os.path.exists(os.path.join(dirpath, each_file)):
os.remove(os.path.join(dirpath, each_file))
# create list of plugins
plugin_directories = ['','/common','/common/multipleComparisonCorrections','/common/multipleComparisonCorrections/additional',
'/groups', '/groups/effectSizeFilters','/groups/plots','/groups/plots/configGUI','/groups/statisticalTests',
'/multiGroups', '/multiGroups/effectSizeFilters','/multiGroups/plots','/multiGroups/plots/configGUI', '/multiGroups/postHoc','/multiGroups/statisticalTests',
'/samples','/samples/confidenceIntervalMethods','/samples/effectSizeFilters','/samples/plots','/samples/plots/configGUI','/samples/statisticalTests',
'/samples/statisticalTests/additional','/samples/plots/examples']
plugin_files = []
for directory in plugin_directories:
for files in os.listdir("plugins" + directory):
f1 = "plugins" + directory + "/" + files
if os.path.isfile(f1): # skip directories
f2 = "library/plugins" + directory, [f1]
plugin_files.append(f2)
# grab all additional resource or data files
icon_files = []
for f in os.listdir("icons"):
f1 = "icons/" + f
if os.path.isfile(f1): # skip directories
f2 = "icons", [f1]
icon_files.append(f2)
example_files = []
for f in os.listdir("examples"):
f1 = "examples/" + f
if os.path.isfile(f1): # skip directories
f2 = "examples", [f1]
example_files.append(f2)
else:
if f != '.svn':
for f in os.listdir(f1):
if os.path.isfile(f1 + '/' + f): # skip directories
f2 = f1, [f1 + '/' + f]
example_files.append(f2)
for f in os.listdir('examples'):
f1 = 'examples/' + f
if os.path.isfile(f1): # skip directories
f2 = 'examples', [f1]
example_files.append(f2)
data_files = []
for f in os.listdir("data"):
f1 = "data/" + f
if os.path.isfile(f1): # skip directories
f2 = "data", [f1]
data_files.append(f2)
root_files = ['license.txt', 'STAMP.exe.log', 'readme.txt']
mpl_data_files = mpl.get_py2exe_datafiles()
# setup configuration
setup(
name = "STAMP",
version = "2.0.2",
description = "Statistical analysis of metagenomic profiles",
author = "Donovan Parks",
windows=[{"script":"STAMP.py", "icon_resources": [(1, "icons/programIcon.ico")]}],
console=[{"script":"commandLine.py", "icon_resources": [(1, "icons/programIcon.ico")]}],
options =
{
"py2exe":
{
"unbuffered": True,
"optimize": 2,
"skip_archive": True,
"includes": ["sip", "PyQt4", "sqlite3"],
"packages": ["matplotlib","pytz","scipy","mpl_toolkits", "pyparsing", "biom", "pyqi"],
"dll_excludes": ["libgdk_pixbuf-2.0-0.dll","libgdk-win32-2.0-0.dll", "libgobject-2.0-0.dll", "tcl84.dll", "tk84.dll"],
}
},
zipfile = "library/",
data_files = icon_files + example_files + data_files + root_files + plugin_files + mpl_data_files,
)