source: sasview/sansview/setup_exe.py @ 3b69ca6

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since 3b69ca6 was e284116, checked in by Jae Cho <jhjcho@…>, 16 years ago

added test folder for sample data

  • Property mode set to 100644
File size: 3.6 KB
RevLine 
[b30f001]1#!/usr/bin/env python
2
3#
[365a17f6]4# The setup to create a Windows executable.
5# Inno Setup can then be used with the installer.iss file
6# in the top source directory to create an installer.
[b30f001]7#
[365a17f6]8# Setuptools clashes with py2exe 0.6.8 (and probably later too).
9# For that reason, most of the code needs to have direct imports
10# that are not going through pkg_resources.
11#
12# Attention should be paid to dynamic imports. Data files can
13# be added to the distribution directory for that purpose.
14# See for example the 'images' directory below.
[b30f001]15
16import os, sys
17from distutils.core import setup
18from distutils.filelist import findall
19import matplotlib
20import py2exe
21
22manifest = """
23   <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
24   <assembly xmlns="urn:schemas-microsoft-com:asm.v1"
25   manifestVersion="1.0">
26   <assemblyIdentity
27       version="0.64.1.0"
28       processorArchitecture="x86"
29       name="Controls"
30       type="win32"
31   />
[365a17f6]32   <description>SansView</description>
[b30f001]33   <dependency>
34       <dependentAssembly>
35           <assemblyIdentity
36               type="win32"
37               name="Microsoft.Windows.Common-Controls"
38               version="6.0.0.0"
39               processorArchitecture="X86"
40               publicKeyToken="6595b64144ccf1df"
41               language="*"
42           />
43       </dependentAssembly>
44   </dependency>
45   </assembly>
46  """
47
48   
49class Target:
50    def __init__(self, **kw):
51        self.__dict__.update(kw)
52        # for the versioninfo resources
[fcad8e4]53        self.version = "0.9"
[b30f001]54        self.company_name = "U Tennessee"
[c9795f6]55        self.copyright = "copyright 2009"
[365a17f6]56        self.name = "SansView"
[b30f001]57       
58#
59# Adapted from http://www.py2exe.org/index.cgi/MatPlotLib
60# to use the MatPlotLib.
61#
62matplotlibdatadir = matplotlib.get_data_path()
63matplotlibdata = findall(matplotlibdatadir)
[365a17f6]64data_files = []
[b30f001]65
66for f in matplotlibdata:
[365a17f6]67    dirname = os.path.join('mpl-data', f[len(matplotlibdatadir)+1:])
68    data_files.append((os.path.split(dirname)[0], [f]))
[b30f001]69
[25b9c26d]70# Copy the settings file for the DataLoader file extension associations
71import DataLoader.readers
72f = os.path.join(DataLoader.readers.get_data_path(),'defaults.xml')
73if os.path.isfile(f):
74    data_files.append(('.', [f]))
75
[365a17f6]76# Copying the images directory to the distribution directory.
77for f in findall('images'):
78    if os.path.split(f)[0].count('.svn')==0:
79        data_files.append((os.path.split(f)[0], [f]))
[d35420d]80
81# Copying the HTML help docs
82for f in findall('doc'):
83    if os.path.split(f)[0].count('.svn')==0:
84        data_files.append((os.path.split(f)[0], [f]))
[e284116]85
86# Copying the sample data user data
87for f in findall('test'):
88    if os.path.split(f)[0].count('.svn')==0:
89        data_files.append((os.path.split(f)[0], [f]))
90
[365a17f6]91   
[b30f001]92#
93# packages
94#
[365a17f6]95packages = ['matplotlib', 'pytz']
[b30f001]96includes = []
[365a17f6]97excludes = [] 
[b30f001]98
99dll_excludes = [
100    'libgdk_pixbuf-2.0-0.dll', 
101    'libgobject-2.0-0.dll',
102    'libgdk-win32-2.0-0.dll',
103    ]
104
105target_wx_client = Target(
[365a17f6]106    description = 'SanView',
[b30f001]107    script = 'sansview.py',
108    icon_resources = [(1, "images/ball.ico")],
109    other_resources = [(24,1,manifest)],
[365a17f6]110    dest_base = "SansView"
[b30f001]111    )
112
113
114
115setup(
116    windows=[target_wx_client],
117    console=[],
118   
119    options={
120        'py2exe': {
121            'dll_excludes': dll_excludes,
122            'packages' : packages,
123            'includes':includes,
124            'excludes':excludes,
125            "compressed": 1,
126            "optimize": 0,
127            "bundle_files":2,
128            },
129    },
[365a17f6]130    data_files=data_files
[b30f001]131   
132)
133
134
Note: See TracBrowser for help on using the repository browser.