forked from dkav/Circuitscape.py
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-win.py
61 lines (51 loc) · 1.73 KB
/
setup-win.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
"""
This is a setup.py script generated by py2applet
Usage:
python setup.py py2exe
"""
import os
import py2exe
from distutils.core import setup
from circuitscape import __version__, __author__, __email__
DATA_FILES = ['circuitscape/cs_logo.jpg', 'circuitscape/gui_rsrc.py',
'cs_logo.ico']
OPTIONS = {'includes': ['PythonCard', 'wx', 'wxversion', 'numpy', 'scipy',
'pyamg', 'scipy.io.matlab.streams'],
'excludes': ['Tkconstants', 'Tkinter']}
# Compile cs_run.py first to ensure that dependencies needed for cs_gui also included.
setup(
console=['bin/csrun.py'],
data_files=DATA_FILES,
options={'py2exe': OPTIONS},
version=__version__,
author= __author__,
author_email=__email__
)
setup(
console = [
{
"script": "bin/csgui.py",
"icon_resources": [(1, "cs_logo.ico")]
}
],
data_files=DATA_FILES,
options={'py2exe': OPTIONS},
version=__version__,
author= __author__,
author_email=__email__
)
import os, shutil
# Copy subdirectories
if os.path.exists('dist/circuitscape'):
shutil.rmtree('dist/circuitscape')
if os.path.exists('dist/examples'):
shutil.rmtree('dist/examples')
shutil.copytree('circuitscape/verify', 'dist/circuitscape/verify')
shutil.copytree('examples', 'dist/examples')
shutil.copyfile('circuitscape/cs_logo.jpg','dist/circuitscape/cs_logo.jpg')
# shutil.copyfile('docs/4.0/circuitscape_4_0.pdf', 'dist/circuitscape_4_0.pdf')
# Rename command line executable for backward compatibility
if os.path.exists('dist/cs_run.exe'):
os.remove('dist/cs_run.exe')
os.rename('dist/csrun.exe','dist/cs_run.exe')
# Note: if having pythoncard problems see http://www.py2exe.org/index.cgi/PythonCardSetup