source: sasview/sansview/setup_exe.py @ aef2cf2

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 aef2cf2 was e5d76ce, checked in by Mathieu Doucet <doucetm@…>, 15 years ago

sansview: clean up

  • Property mode set to 100644
File size: 3.8 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
[cc1500d]17   
[b30f001]18from distutils.core import setup
19from distutils.filelist import findall
20import matplotlib
21import py2exe
22
23manifest = """
24   <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
25   <assembly xmlns="urn:schemas-microsoft-com:asm.v1"
26   manifestVersion="1.0">
27   <assemblyIdentity
28       version="0.64.1.0"
29       processorArchitecture="x86"
30       name="Controls"
31       type="win32"
32   />
[365a17f6]33   <description>SansView</description>
[b30f001]34   <dependency>
35       <dependentAssembly>
36           <assemblyIdentity
37               type="win32"
38               name="Microsoft.Windows.Common-Controls"
39               version="6.0.0.0"
40               processorArchitecture="X86"
41               publicKeyToken="6595b64144ccf1df"
42               language="*"
43           />
44       </dependentAssembly>
45   </dependency>
46   </assembly>
47  """
48
49   
50class Target:
51    def __init__(self, **kw):
52        self.__dict__.update(kw)
53        # for the versioninfo resources
[3c939e5]54        self.version = "0.9.1"
[b30f001]55        self.company_name = "U Tennessee"
[c9795f6]56        self.copyright = "copyright 2009"
[365a17f6]57        self.name = "SansView"
[b30f001]58       
59#
60# Adapted from http://www.py2exe.org/index.cgi/MatPlotLib
61# to use the MatPlotLib.
62#
63matplotlibdatadir = matplotlib.get_data_path()
64matplotlibdata = findall(matplotlibdatadir)
[365a17f6]65data_files = []
[a90a3c84]66# Copying SLD data
[c93cc15]67import periodictable
[cc1500d]68import logging
[b30f001]69
[c93cc15]70data_files += periodictable.data_files()
71
72
[b30f001]73for f in matplotlibdata:
[365a17f6]74    dirname = os.path.join('mpl-data', f[len(matplotlibdatadir)+1:])
75    data_files.append((os.path.split(dirname)[0], [f]))
[b30f001]76
[25b9c26d]77# Copy the settings file for the DataLoader file extension associations
78import DataLoader.readers
79f = os.path.join(DataLoader.readers.get_data_path(),'defaults.xml')
80if os.path.isfile(f):
81    data_files.append(('.', [f]))
82
[365a17f6]83# Copying the images directory to the distribution directory.
84for f in findall('images'):
85    if os.path.split(f)[0].count('.svn')==0:
86        data_files.append((os.path.split(f)[0], [f]))
[d35420d]87
88# Copying the HTML help docs
[e5d76ce]89for f in findall('media'):
[d35420d]90    if os.path.split(f)[0].count('.svn')==0:
91        data_files.append((os.path.split(f)[0], [f]))
[e284116]92
93# Copying the sample data user data
94for f in findall('test'):
95    if os.path.split(f)[0].count('.svn')==0:
96        data_files.append((os.path.split(f)[0], [f]))
[1b16714f]97       
98# Copying the sample data user data
99for f in findall('plugins'):
100    if os.path.split(f)[0].count('.svn')==0:
101        data_files.append((os.path.split(f)[0], [f]))
[e284116]102
[365a17f6]103   
[b30f001]104#
105# packages
106#
[3c939e5]107packages = ['matplotlib', 'pytz','encodings']
[b30f001]108includes = []
[365a17f6]109excludes = [] 
[b30f001]110
111dll_excludes = [
112    'libgdk_pixbuf-2.0-0.dll', 
113    'libgobject-2.0-0.dll',
114    'libgdk-win32-2.0-0.dll',
115    ]
116
117target_wx_client = Target(
[7f7e5f1]118    description = 'SansView',
[b30f001]119    script = 'sansview.py',
120    icon_resources = [(1, "images/ball.ico")],
121    other_resources = [(24,1,manifest)],
[365a17f6]122    dest_base = "SansView"
[b30f001]123    )
124
125
126
127setup(
128    windows=[target_wx_client],
129    console=[],
130   
131    options={
132        'py2exe': {
133            'dll_excludes': dll_excludes,
134            'packages' : packages,
135            'includes':includes,
136            'excludes':excludes,
137            "compressed": 1,
138            "optimize": 0,
139            "bundle_files":2,
140            },
141    },
[c93cc15]142    data_files=data_files,
[b30f001]143   
144)
145
146
Note: See TracBrowser for help on using the repository browser.