Hi Andrew,

Andrew Straw wrote:
...
Dear Werner,

I am reluctant to eliminate the sub-folder structure because I think it would add the possibility of unnecessary bugs to just the py2exe built version. Would it be possible for you to re-factor this to include the directory layout? When you test it, can you test some interactive plot to make sure all the button icons are loaded properly?
I don't know how to change "matplotlib.get_py2exe_datafiles()" to retain the folder structure. But in the attached setup.py I used "matplotlib.get_data_path()" for each of the sub-folders and then define the folder structure again in the py2exe "data_files" section. The enclosed setup.py builds an exe for embedding_in_wx.py and I have no problems running it and the toolbar shows all its icons.

I am also enclosing some example files which I have upgraded to the new wxPython namespace - I had sent them some time ago but the examples.zip file I just downloaded contains the old versions.

dynamic_demo_wx.py, namespace changes and a OnClose event to stop the timer (otherwise the script can not be stopped by clicking on the X).
dynamic_image_wxagg.py, namespace changes
dynamic_image_wxagg2.py, namespace changes and removed numarray stuff.
embedding_in_wx.py, namespace changes
embedding_in_wx2.py, namespace changes
embedding_in_wx4.py, namespace changes

Can you update the zip file with the above files?

Best regards
Werner
#!/usr/bin/env python
"""
An example of how to use wx or wxagg in an application with a custom
toolbar
"""

from matplotlib.numerix import arange, sin, pi

import matplotlib

# uncomment the following to use wx rather than wxagg
#matplotlib.use('WX')
#from matplotlib.backends.backend_wx import FigureCanvasWx as FigureCanvas

# comment out the following to use wx rather than wxagg
matplotlib.use('WXAgg')
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.backends.backend_wxagg import NavigationToolbar2WxAgg

from matplotlib.backends.backend_wx import _load_bitmap
from matplotlib.figure import Figure
from matplotlib.numerix.mlab import rand

import wx

class MyNavigationToolbar(NavigationToolbar2WxAgg):
    """
    Extend the default wx toolbar with your own event handlers
    """
    ON_CUSTOM = wx.NewId()
    def __init__(self, canvas, cankill):
        NavigationToolbar2WxAgg.__init__(self, canvas)

        # for simplicity I'm going to reuse a bitmap from wx, you'll
        # probably want to add your own.
        self.AddSimpleTool(self.ON_CUSTOM, _load_bitmap('stock_left.xpm'),
                           'Click me', 'Activate custom contol')
        self.Bind(wx.EVT_TOOL, self._on_custom, id=self.ON_CUSTOM)

    def _on_custom(self, evt):
        # add some text to the axes in a random location in axes (0,1)
        # coords) with a random color

        # get the axes
        ax = self.canvas.figure.axes[0]

        # generate a random location can color
        x,y = tuple(rand(2))
        rgb = tuple(rand(3))

        # add the text and draw
        ax.text(x, y, 'You clicked me',
                transform=ax.transAxes,
                color=rgb)
        self.canvas.draw()
        evt.Skip()


class CanvasFrame(wx.Frame):

    def __init__(self):
        wx.Frame.__init__(self,None,-1,
                         'CanvasFrame',size=(550,350))

        self.SetBackgroundColour(wx.NamedColor("WHITE"))

        self.figure = Figure(figsize=(5,4), dpi=100)
        self.axes = self.figure.add_subplot(111)
        t = arange(0.0,3.0,0.01)
        s = sin(2*pi*t)

        self.axes.plot(t,s)

        self.canvas = FigureCanvas(self, -1, self.figure)

        self.sizer = wx.BoxSizer(wx.VERTICAL)
        self.sizer.Add(self.canvas, 1, wx.TOP | wx.LEFT | wx.EXPAND)
        # Capture the paint message
        self.Bind(wx.EVT_PAINT, self.OnPaint)

        self.toolbar = MyNavigationToolbar(self.canvas, True)
        self.toolbar.Realize()
        if wx.Platform == '__WXMAC__':
            # Mac platform (OSX 10.3, MacPython) does not seem to cope with
            # having a toolbar in a sizer. This work-around gets the buttons
            # back, but at the expense of having the toolbar at the top
            self.SetToolBar(self.toolbar)
        else:
            # On Windows platform, default window size is incorrect, so set
            # toolbar width to figure width.
            tw, th = self.toolbar.GetSizeTuple()
            fw, fh = self.canvas.GetSizeTuple()
            # By adding toolbar in sizer, we are able to put it at the bottom
            # of the frame - so appearance is closer to GTK version.
            # As noted above, doesn't work for Mac.
            self.toolbar.SetSize(wx.Size(fw, th))
            self.sizer.Add(self.toolbar, 0, wx.LEFT | wx.EXPAND)

        # update the axes menu on the toolbar
        self.toolbar.update()
        self.SetSizer(self.sizer)
        self.Fit()


    def OnPaint(self, event):
        self.canvas.draw()
        event.Skip()

class App(wx.App):

    def OnInit(self):
        'Create the main window and insert the custom frame'
        frame = CanvasFrame()
        frame.Show(True)

        return True

app = App(0)
app.MainLoop()
#!/usr/bin/env python
"""
Copyright (C) Jeremy O'Donoghue, 2003

License: This work is licensed under the PSF. A copy should be included
with this source code, and is also available at
http://www.python.org/psf/license.html

This is a sample showing how to embed a matplotlib figure in a wxPanel,
and update the contents whenever a timer event occurs. It is inspired
by the GTK script dynamic_demo.py, by John Hunter (should be supplied with
this file) but I have assumed that you may wish to embed a figure inside
your own arbitrary frame, which makes the code slightly more complicated.

It goes without saying that you can update the display on any event, not
just a timer...

Should you require a toolbar and navigation, inspire yourself from
embedding_in_wx.py, which provides these features.

Modification History:
$Log$
Revision 1.7  2005/06/15 20:24:56  jdh2358
syncing for 82

Revision 1.6  2004/10/26 18:08:13  astraw
Converted to use new NavigationToolbar2 (from old Toolbar).

Revision 1.5  2004/06/26 06:37:20  astraw
Trivial bugfix to eliminate IndexError

Revision 1.4  2004/05/03 12:12:26  jdh2358
added bang header to examples

Revision 1.3  2004/03/08 22:17:20  jdh2358

* Fixed embedding_in_wx and dynamic_demo_wx examples

* Ported build to darwin

* Tk:

  removed default figman=None from nav toolbar since it needs the
  figman

  fixed close bug

  small changes to aid darwin build

Revision 1.2  2004/02/26 20:22:58  jaytmiller
Added the "numerix" Numeric/numarray selector module enabling matplotlib
to work with either numarray or Numeric.  See matplotlib.numerix.__doc__.

Revision 1.1  2003/12/30 17:22:09  jodonoghue
First version of dynamic_demo for backend_wx
"""


import matplotlib
matplotlib.use('WX')
from matplotlib.backends.backend_wx import FigureCanvasWx,\
     FigureManager, NavigationToolbar2Wx

from matplotlib.figure import Figure
from matplotlib.axes import Subplot
import matplotlib.numerix as numpy
import wx


TIMER_ID = wx.NewId()

class PlotFigure(wx.Frame):

    def __init__(self):
        wx.Frame.__init__(self, None, -1, "Test embedded wxFigure")

        self.fig = Figure((5,4), 75)
        self.canvas = FigureCanvasWx(self, -1, self.fig)
        self.toolbar = NavigationToolbar2Wx(self.canvas)
        self.toolbar.Realize()

        # On Windows, default frame size behaviour is incorrect
        # you don't need this under Linux
        tw, th = self.toolbar.GetSizeTuple()
        fw, fh = self.canvas.GetSizeTuple()
        self.toolbar.SetSize(wx.Size(fw, th))

        # Create a figure manager to manage things
        self.figmgr = FigureManager(self.canvas, 1, self)
        # Now put all into a sizer
        sizer = wx.BoxSizer(wx.VERTICAL)
        # This way of adding to sizer allows resizing
        sizer.Add(self.canvas, 1, wx.LEFT|wx.TOP|wx.GROW)
        # Best to allow the toolbar to resize!
        sizer.Add(self.toolbar, 0, wx.GROW)
        self.SetSizer(sizer)
        self.Fit()
        self.Bind(wx.EVT_TIMER, self.onTimer, id=TIMER_ID)
        self.Bind(wx.EVT_CLOSE, self.onClose)

    def init_plot_data(self):
        a = self.fig.add_subplot(111)
        self.ind = numpy.arange(60)
        tmp = []
        for i in range(60):
            tmp.append(numpy.sin((self.ind+i)*numpy.pi/15))
        self.X = numpy.array(tmp)
        self.lines = a.plot(self.X[:,0],'o')
        self.count = 0

    def GetToolBar(self):
        # You will need to override GetToolBar if you are using an
        # unmanaged toolbar in your frame
        return self.toolbar

    def onTimer(self, evt):
        self.count += 1
        if self.count >= 60: self.count = 0
        self.lines[0].set_data(self.ind, self.X[:,self.count])
        self.canvas.draw()
        self.canvas.gui_repaint()

    def onClose(self, evt):
        self.t.Stop()
        evt.Skip()


if __name__ == '__main__':
    app = wx.PySimpleApp()
    frame = PlotFigure()
    frame.init_plot_data()

    # Initialise the timer - wxPython requires this to be connected to the
    # receivicng event handler
    t = wx.Timer(frame, TIMER_ID)
    t.Start(100)

    frame.Show()
    app.MainLoop()
#!/usr/bin/env python
"""
Copyright (C) 2003-2004 Jeremy O'Donoghue and others

License: This work is licensed under the PSF. A copy should be included
with this source code, and is also available at
http://www.python.org/psf/license.html

"""
import sys, time, os, gc

import matplotlib
matplotlib.use('WXAgg')

# jdh: you need to control Numeric vs numarray with numerix, otherwise
# matplotlib may be using numeric under the hood and while you are
# using numarray and this isn't efficient.  Also, if you use
# numerix=numarray, it is important to compile matplotlib for numarray
# by setting NUMERIX = 'numarray' in setup.py before building
from matplotlib import rcParams
##rcParams['numerix'] = 'numarray'


# jdh: you can import cm directly, you don't need to go via
# pylab
import matplotlib.cm as cm

from matplotlib.backends.backend_wxagg import Toolbar, FigureCanvasWxAgg

# jdh: you don't need a figure manager in the GUI - this class was
# designed for the pylab interface

from matplotlib.figure import Figure
import matplotlib.numerix as numerix
import wx


TIMER_ID = wx.NewId()

class PlotFigure(wx.Frame):

    def __init__(self):
        wx.Frame.__init__(self, None, -1, "Test embedded wxFigure")

        self.fig = Figure((5,4), 75)
        self.canvas = FigureCanvasWxAgg(self, -1, self.fig)
        self.toolbar = Toolbar(self.canvas)
        self.toolbar.Realize()

        # On Windows, default frame size behaviour is incorrect
        # you don't need this under Linux
        tw, th = self.toolbar.GetSizeTuple()
        fw, fh = self.canvas.GetSizeTuple()
        self.toolbar.SetSize(wx.Size(fw, th))

        # Initialise the timer - wxPython requires this to be connected to
        # the receiving event handler
        self.t = wx.Timer(self, TIMER_ID)
        self.t.Start(10)

        # Create a figure manager to manage things

        # Now put all into a sizer
        sizer = wx.BoxSizer(wx.VERTICAL)
        # This way of adding to sizer allows resizing
        sizer.Add(self.canvas, 1, wx.LEFT|wx.TOP|wx.GROW)
        # Best to allow the toolbar to resize!
        sizer.Add(self.toolbar, 0, wx.GROW)
        self.SetSizer(sizer)
        self.Fit()
        self.Bind(wx.EVT_TIMER, self.onTimer, id=TIMER_ID)
        self.Bind(wx.EVT_CLOSE, self.onClose)

    def init_plot_data(self):
        # jdh you can add a subplot directly from the fig rather than
        # the fig manager
        a = self.fig.add_subplot(111)
        self.x = numerix.arange(120.0)*2*numerix.pi/120.0
        self.x.resize((100,120))
        self.y = numerix.arange(100.0)*2*numerix.pi/100.0
        self.y.resize((120,100))
        self.y = numerix.transpose(self.y)
        z = numerix.sin(self.x) + numerix.cos(self.y)
        self.im = a.imshow( z, cmap=cm.jet)#, interpolation='nearest')

    def GetToolBar(self):
        # You will need to override GetToolBar if you are using an
        # unmanaged toolbar in your frame
        return self.toolbar

    def onTimer(self, evt):
        self.x += numerix.pi/15
        self.y += numerix.pi/20
        z = numerix.sin(self.x) + numerix.cos(self.y)
        self.im.set_array(z)
        self.canvas.draw()
        #self.canvas.gui_repaint()  # jdh wxagg_draw calls this already

    def onClose(self, evt):
        self.t.Stop()
        evt.Skip()

    def onEraseBackground(self, evt):
        # this is supposed to prevent redraw flicker on some X servers...
        pass

if __name__ == '__main__':
    app = wx.PySimpleApp()
    frame = PlotFigure()
    frame.init_plot_data()

    frame.Show()
    app.MainLoop()
#!/usr/bin/env python
"""
Copyright (C) 2003-2005 Jeremy O'Donoghue and others

License: This work is licensed under the PSF. A copy should be included
with this source code, and is also available at
http://www.python.org/psf/license.html

"""
import sys, time, os, gc

import matplotlib
matplotlib.use('WXAgg')


# jdh: you can import cm directly, you don't need to go via
# pylab
import matplotlib.cm as cm

from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg
from matplotlib.backends.backend_wx import NavigationToolbar2Wx

# jdh: you don't need a figure manager in the GUI - this class was
# designed for the pylab interface

from matplotlib.figure import Figure
import matplotlib.numerix as numerix
import wx


TIMER_ID = wx.NewId()

class PlotFigure(wx.Frame):

    def __init__(self):
        wx.Frame.__init__(self, None, -1, "Test embedded wxFigure")

        self.fig = Figure((5,4), 75)
        self.canvas = FigureCanvasWxAgg(self, -1, self.fig)
        self.toolbar = NavigationToolbar2Wx(self.canvas)
        self.toolbar.Realize()

        # On Windows, default frame size behaviour is incorrect
        # you don't need this under Linux
        tw, th = self.toolbar.GetSizeTuple()
        fw, fh = self.canvas.GetSizeTuple()
        self.toolbar.SetSize(wx.Size(fw, th))

        # Create a figure manager to manage things

        # Now put all into a sizer
        sizer = wx.BoxSizer(wx.VERTICAL)
        # This way of adding to sizer allows resizing
        sizer.Add(self.canvas, 1, wx.LEFT|wx.TOP|wx.GROW)
        # Best to allow the toolbar to resize!
        sizer.Add(self.toolbar, 0, wx.GROW)
        self.SetSizer(sizer)
        self.Fit()
        self.Bind(wx.EVT_TIMER, self.onTimer, id=TIMER_ID)

    def init_plot_data(self):
        # jdh you can add a subplot directly from the fig rather than
        # the fig manager
        a = self.fig.add_axes([0.075,0.1,0.75,0.85])
        cax = self.fig.add_axes([0.85,0.1,0.075,0.85])
        self.x = numerix.arange(120.0)*2*numerix.pi/120.0
        self.x.resize((100,120))
        self.y = numerix.arange(100.0)*2*numerix.pi/100.0
        self.y.resize((120,100))
        self.y = numerix.transpose(self.y)
        z = numerix.sin(self.x) + numerix.cos(self.y)
        self.im = a.imshow( z, cmap=cm.jet)#, interpolation='nearest')
        self.fig.colorbar(self.im,cax=cax,orientation='vertical')

    def GetToolBar(self):
        # You will need to override GetToolBar if you are using an
        # unmanaged toolbar in your frame
        return self.toolbar

    def onTimer(self, evt):
        self.x += numerix.pi/15
        self.y += numerix.pi/20
        z = numerix.sin(self.x) + numerix.cos(self.y)
        self.im.set_array(z)
        self.canvas.draw()
        #self.canvas.gui_repaint()  # jdh wxagg_draw calls this already

    def onEraseBackground(self, evt):
        # this is supposed to prevent redraw flicker on some X servers...
        pass

if __name__ == '__main__':
    app = wx.PySimpleApp()
    frame = PlotFigure()
    frame.init_plot_data()

    # Initialise the timer - wxPython requires this to be connected to
    # the receiving event handler
    t = wx.Timer(frame, TIMER_ID)
    t.Start(200)

    frame.Show()
    app.MainLoop()
#!/usr/bin/env python
# embedding_in_wx.py
#

"""
Copyright (C) Jeremy O'Donoghue, 2003

License: This work is licensed under the PSF. A copy should be included
with this source code, and is also available at
http://www.python.org/psf/license.html

This is a sample showing how to embed a matplotlib figure in a wxPanel.

The example implements the full navigation toolbar, so you can automatically
inherit standard matplotlib features such as the ability to zoom, pan and
save figures in the supported formats.

There are a few small complexities worth noting in the example:

1) By default, a wxFrame can contain a toolbar (added with SetToolBar())
   but this is at the top of the frame. Matplotlib default is to put the
   controls at the bottom of the frame, so you have to manage the toolbar
   yourself. I have done this by putting the figure and toolbar into a
   sizer, but this means that you need to override GetToolBar for your
   wxFrame so that the figure manager can find the toolbar.

2) I have implemented a figure manager to look after the plots and axes.
   If you don't want a toolbar, it is simpler to add the figure directly
   and not worry. However, the figure manager looks after clipping of the
   figure contents, so you will need it if you want to navigate

3) There is a bug in the way in which my copy of wxPython calculates
   toolbar width on Win32, so there is a tricky line to ensure that the
   width of the toolbat is the same as the width of the figure.

4) Depending on the parameters you pass to the sizer, you can make the
   figure resizable or not.
"""

import matplotlib
matplotlib.use('WX')
from matplotlib.backends.backend_wx import Toolbar, FigureCanvasWx,\
     FigureManager

from matplotlib.figure import Figure
from matplotlib.axes import Subplot
import matplotlib.numerix as numpy
import wx



class PlotFigure(wx.Frame):
    def __init__(self):
        wx.Frame.__init__(self, None, -1, "Test embedded wxFigure")

        self.fig = Figure((9,8), 75)
        self.canvas = FigureCanvasWx(self, -1, self.fig)
        self.toolbar = Toolbar(self.canvas)
        self.toolbar.Realize()

        # On Windows, default frame size behaviour is incorrect
        # you don't need this under Linux
        tw, th = self.toolbar.GetSizeTuple()
        fw, fh = self.canvas.GetSizeTuple()
        self.toolbar.SetSize(wx.Size(fw, th))

        # Create a figure manager to manage things
        self.figmgr = FigureManager(self.canvas, 1, self)
        # Now put all into a sizer
        sizer = wx.BoxSizer(wx.VERTICAL)
        # This way of adding to sizer allows resizing
        sizer.Add(self.canvas, 1, wx.LEFT|wx.TOP|wx.GROW)
        # Best to allow the toolbar to resize!
        sizer.Add(self.toolbar, 0, wx.GROW)
        self.SetSizer(sizer)
        self.Fit()

    def plot_data(self):
        # Use ths line if using a toolbar
        a = self.fig.add_subplot(111)

        # Or this one if there is no toolbar
        #a = Subplot(self.fig, 111)

        t = numpy.arange(0.0,3.0,0.01)
        s = numpy.sin(2*numpy.pi*t)
        c = numpy.cos(2*numpy.pi*t)
        a.plot(t,s)
        a.plot(t,c)
        self.toolbar.update()

    def GetToolBar(self):
        # You will need to override GetToolBar if you are using an
        # unmanaged toolbar in your frame
        return self.toolbar

if __name__ == '__main__':
    app = wx.PySimpleApp(0)
    frame = PlotFigure()
    frame.plot_data()
    frame.Show()
    app.MainLoop()
#!/usr/bin/env python
"""
An example of how to use wx or wxagg in an application with the new
toolbar - comment out the setA_toolbar line for no toolbar
"""

from matplotlib.numerix import arange, sin, pi

import matplotlib

# uncomment the following to use wx rather than wxagg
#matplotlib.use('WX')
#from matplotlib.backends.backend_wx import FigureCanvasWx as FigureCanvas

# comment out the following to use wx rather than wxagg
matplotlib.use('WXAgg')
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.backends.backend_wx import NavigationToolbar2Wx

from matplotlib.figure import Figure

import wx

class CanvasFrame(wx.Frame):

    def __init__(self):
        wx.Frame.__init__(self,None,-1,
                         'CanvasFrame',size=(550,350))

        self.SetBackgroundColour(wx.NamedColor("WHITE"))

        self.figure = Figure()
        self.axes = self.figure.add_subplot(111)
        t = arange(0.0,3.0,0.01)
        s = sin(2*pi*t)

        self.axes.plot(t,s)
        self.canvas = FigureCanvas(self, -1, self.figure)

        self.sizer = wx.BoxSizer(wx.VERTICAL)
        self.sizer.Add(self.canvas, 1, wx.LEFT | wx.TOP | wx.GROW)
        self.SetSizer(self.sizer)
        self.Fit()

        self.add_toolbar()  # comment this out for no toolbar


    def add_toolbar(self):
        self.toolbar = NavigationToolbar2Wx(self.canvas)
        self.toolbar.Realize()
        if wx.Platform == '__WXMAC__':
            # Mac platform (OSX 10.3, MacPython) does not seem to cope with
            # having a toolbar in a sizer. This work-around gets the buttons
            # back, but at the expense of having the toolbar at the top
            self.SetToolBar(self.toolbar)
        else:
            # On Windows platform, default window size is incorrect, so set
            # toolbar width to figure width.
            tw, th = self.toolbar.GetSizeTuple()
            fw, fh = self.canvas.GetSizeTuple()
            # By adding toolbar in sizer, we are able to put it at the bottom
            # of the frame - so appearance is closer to GTK version.
            # As noted above, doesn't work for Mac.
            self.toolbar.SetSize(wx.Size(fw, th))
            self.sizer.Add(self.toolbar, 0, wx.LEFT | wx.EXPAND)
        # update the axes menu on the toolbar
        self.toolbar.update()


    def OnPaint(self, event):
        self.canvas.draw()

class App(wx.App):

    def OnInit(self):
        'Create the main window and insert the custom frame'
        frame = CanvasFrame()
        frame.Show(True)

        return True

app = App(0)
app.MainLoop()
# -*- coding: iso-8859-1 -*-#
from distutils.core import setup
import os
from os.path import join
import shutil

import glob
import py2exe
from py2exe.build_exe import py2exe
import sys

import matplotlib as mp
matplotlib_font_afm = glob.glob(os.sep.join([mp.get_data_path(), 
'fonts/afm/*']))
matplotlib_font_pdfcorefonts = glob.glob(os.sep.join([mp.get_data_path(), 
'fonts/pdfcorefonts/*']))
matplotlib_font_ttf = glob.glob(os.sep.join([mp.get_data_path(), 
'fonts/ttf/*']))
matplotlib_images = glob.glob(os.sep.join([mp.get_data_path(), 'images/*']))

# following should not be needed as of py2exe 0.6.6
### cleanup dist and build directory first (for new py2exe version)
##if os.path.exists("dist/prog"):
##    shutil.rmtree("dist/prog")
##
##if os.path.exists("dist/lib"):
##    shutil.rmtree("dist/lib")
##
##if os.path.exists("build"):
##    shutil.rmtree("build")
##    

#
# A program using wxPython

# The manifest will be inserted as resource into the .exe.  This
# gives the controls the Windows XP appearance (if run on XP ;-)
#
manifest_template = '''
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
    version="5.0.0.0"
    processorArchitecture="x86"
    name="%(prog)s"
    type="win32"
/>
<description>%(prog)s</description>
<dependency>
    <dependentAssembly>
        <assemblyIdentity
            type="win32"
            name="Microsoft.Windows.Common-Controls"
            version="6.0.0.0"
            processorArchitecture="X86"
            publicKeyToken="6595b64144ccf1df"
            language="*"
        />
    </dependentAssembly>
</dependency>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel
          level="AsInvoker"
          uiAccess="false"/>
        </requestedPrivileges>
       </security>
  </trustInfo>
</assembly>
'''

RT_MANIFEST = 32
#

# options for py2exe
options = {"py2exe": {"compressed": 1,
                      "optimize": 2,
                      "packages": ["encodings",
                                   "pytz", "matplotlib.numerix",
                                   ],
                      "excludes": ["MySQLdb", "Tkconstants", "Tkinter", "tcl"
                      ],
                      "dll_excludes": ["tcl84.dll", "tk84.dll", 
"wxmsw26uh_vc.dll"]
                      }
          }
zipfile = r"lib\library.zip"

class MetaBase:
    def __init__(self, **kw):
        self.__dict__.update(kw)
        self.version = '1.0'
        self.author = "yourname"
        self.author_email = "[EMAIL PROTECTED]"
        self.company_name = ""
        self.copyright = "2003 - 2007 by whoever"
        self.url = "http://www.whatever.com/";
        self.download_url = "http://www.whatever.com/en/";
        self.trademark = ""
        self.comments = "a comment on the prog"
        self.name = "the prog name"
        self.description = "a desc on the prog"

wx_emb = MetaBase(
            script = "embedding_in_wx.py",
            other_resources = [(RT_MANIFEST, 1, manifest_template % 
dict(prog="your prog name"))],
##            icon_resources = [(1, r"images/some.ico")],
            dest_base = r"prog\wx_embed")

setup(
      classifiers = ["Copyright:: your name",
                     "Development Status :: 5 Stable",
                     "Intended Audience :: End User",
                     "License :: Shareware",
                     "Operating System :: Microsoft :: Windows 2000",
                     "Operating System :: Microsoft :: Windows XP",
                     "Operating System :: Microsoft :: Windows 9x",
                     "Programming Language :: Python, wxPython",
                     "Topic :: Home Use"
                     "Natural Language :: German",
                     "Natural Language :: French",
                     "Natural Language :: English"],
      windows = [wx_emb],
      options = options,
      zipfile = zipfile,
      data_files = [("lib\\matplotlibdata", [os.sep.join([mp.get_data_path(), 
'matplotlibrc'])]),
                    ("lib\\matplotlibdata\\fonts\\afm", matplotlib_font_afm),
                    ("lib\\matplotlibdata\\fonts\\pdfcorefonts", 
matplotlib_font_pdfcorefonts),
                    ("lib\\matplotlibdata\\fonts\\ttf", matplotlib_font_ttf),
                    ("lib\\matplotlibdata\\images", matplotlib_images),
                    ]
    )
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to