source: sasview/sansview/setup_exe.py @ d520f1b

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 d520f1b was 698a734, checked in by Gervaise Alina <gervyh@…>, 15 years ago

working on bundle html files

  • Property mode set to 100644
File size: 4.0 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
[698a734]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
[c93cc15]69data_files += periodictable.data_files()
70
[698a734]71import sans.perspectives.calculator as calculator
72data_files += calculator.data_files()
73
74import sans.perspectives.invariant as invariant
75data_files += invariant.data_files()
[c93cc15]76
[b30f001]77for f in matplotlibdata:
[365a17f6]78    dirname = os.path.join('mpl-data', f[len(matplotlibdatadir)+1:])
79    data_files.append((os.path.split(dirname)[0], [f]))
[b30f001]80
[25b9c26d]81# Copy the settings file for the DataLoader file extension associations
82import DataLoader.readers
83f = os.path.join(DataLoader.readers.get_data_path(),'defaults.xml')
84if os.path.isfile(f):
85    data_files.append(('.', [f]))
86
[365a17f6]87# Copying the images directory to the distribution directory.
88for f in findall('images'):
89    if os.path.split(f)[0].count('.svn')==0:
90        data_files.append((os.path.split(f)[0], [f]))
[d35420d]91
92# Copying the HTML help docs
[e5d76ce]93for f in findall('media'):
[d35420d]94    if os.path.split(f)[0].count('.svn')==0:
95        data_files.append((os.path.split(f)[0], [f]))
[e284116]96
97# Copying the sample data user data
98for f in findall('test'):
99    if os.path.split(f)[0].count('.svn')==0:
100        data_files.append((os.path.split(f)[0], [f]))
[1b16714f]101       
102# Copying the sample data user data
103for f in findall('plugins'):
104    if os.path.split(f)[0].count('.svn')==0:
105        data_files.append((os.path.split(f)[0], [f]))
[e284116]106
[365a17f6]107   
[b30f001]108#
109# packages
110#
[3c939e5]111packages = ['matplotlib', 'pytz','encodings']
[b30f001]112includes = []
[365a17f6]113excludes = [] 
[b30f001]114
115dll_excludes = [
116    'libgdk_pixbuf-2.0-0.dll', 
117    'libgobject-2.0-0.dll',
118    'libgdk-win32-2.0-0.dll',
119    ]
120
121target_wx_client = Target(
[7f7e5f1]122    description = 'SansView',
[b30f001]123    script = 'sansview.py',
124    icon_resources = [(1, "images/ball.ico")],
125    other_resources = [(24,1,manifest)],
[365a17f6]126    dest_base = "SansView"
[b30f001]127    )
128
129
130
131setup(
132    windows=[target_wx_client],
133    console=[],
134   
135    options={
136        'py2exe': {
137            'dll_excludes': dll_excludes,
138            'packages' : packages,
139            'includes':includes,
140            'excludes':excludes,
141            "compressed": 1,
142            "optimize": 0,
143            "bundle_files":2,
144            },
145    },
[c93cc15]146    data_files=data_files,
[b30f001]147   
148)
149
150
Note: See TracBrowser for help on using the repository browser.