1 | #!/usr/bin/env python |
---|
2 | |
---|
3 | # |
---|
4 | # The setup to create a single exe file. |
---|
5 | # |
---|
6 | |
---|
7 | import os, sys |
---|
8 | |
---|
9 | from distutils.core import setup |
---|
10 | |
---|
11 | from distutils.filelist import findall |
---|
12 | |
---|
13 | import matplotlib |
---|
14 | |
---|
15 | import py2exe |
---|
16 | |
---|
17 | |
---|
18 | class Target: |
---|
19 | def __init__(self, **kw): |
---|
20 | self.__dict__.update(kw) |
---|
21 | # for the versioninfo resources |
---|
22 | self.version = "0.1" |
---|
23 | self.company_name = "U Tennessee" |
---|
24 | self.copyright = "copyright 2008" |
---|
25 | self.name = "PrView" |
---|
26 | |
---|
27 | # |
---|
28 | # Adapted from http://www.py2exe.org/index.cgi/MatPlotLib |
---|
29 | # to use the MatPlotLib. |
---|
30 | # |
---|
31 | matplotlibdatadir = matplotlib.get_data_path() |
---|
32 | matplotlibdata = findall(matplotlibdatadir) |
---|
33 | matplotlibdata_files = [] |
---|
34 | |
---|
35 | for f in matplotlibdata: |
---|
36 | dirname = os.path.join('matplotlibdata', f[len(matplotlibdatadir)+1:]) |
---|
37 | matplotlibdata_files.append((os.path.split(dirname)[0], [f])) |
---|
38 | |
---|
39 | # |
---|
40 | # packages |
---|
41 | # |
---|
42 | packages = [ |
---|
43 | 'matplotlib', 'pytz' |
---|
44 | ] |
---|
45 | |
---|
46 | includes = [] |
---|
47 | excludes = ['OpenGL'] |
---|
48 | |
---|
49 | dll_excludes = [ |
---|
50 | 'libgdk_pixbuf-2.0-0.dll', |
---|
51 | 'libgobject-2.0-0.dll', |
---|
52 | 'libgdk-win32-2.0-0.dll', |
---|
53 | ] |
---|
54 | |
---|
55 | ## This is the client for PARK: run on wx |
---|
56 | target_wx_client = Target( |
---|
57 | description = 'P(r) inversion viewer', |
---|
58 | script = 'sansview.py', |
---|
59 | #other_resources = [(RT_MANIFEST, 1, manifest_template % dict(prog="AppJob"))], |
---|
60 | icon_resources = [(1, "images/ball.ico")], |
---|
61 | dest_base = "prView" |
---|
62 | ) |
---|
63 | |
---|
64 | |
---|
65 | |
---|
66 | setup( |
---|
67 | windows=[target_wx_client], |
---|
68 | console=[], |
---|
69 | |
---|
70 | options={ |
---|
71 | 'py2exe': { |
---|
72 | 'dll_excludes': dll_excludes, |
---|
73 | 'packages' : packages, |
---|
74 | 'includes':includes, |
---|
75 | 'excludes':excludes, |
---|
76 | "compressed": 1, |
---|
77 | "optimize": 0, |
---|
78 | "bundle_files":2, |
---|
79 | }, |
---|
80 | }, |
---|
81 | data_files=matplotlibdata_files |
---|
82 | |
---|
83 | # Do something like this to add images to the distribution |
---|
84 | #data_files=[ ("prog",["kategorien.xml",])] |
---|
85 | ) |
---|
86 | |
---|
87 | |
---|