Control: tags 759066 + patch
Control: severity -1 serious
# Justification: blocks an on-going transition

Dear maintainer,

The attached patch updates model-builder for wxPython 3.0.

However, I'm unable to test it as rebuilding the package fails due to the
existing FTBFS issue filed as #750275.

Cheers,
    Olly
diff -Nru model-builder-0.4.1/debian/changelog model-builder-0.4.1/debian/changelog
--- model-builder-0.4.1/debian/changelog	2013-06-01 08:48:08.000000000 -0300
+++ model-builder-0.4.1/debian/changelog	2014-09-14 20:53:14.000000000 -0300
@@ -1,3 +1,11 @@
+model-builder (0.4.1-6.2) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Update for wxPython 3.0 (Closes: #759066):
+    - New patch: wxpython3.0.patch
+
+ -- Olly Betts <o...@survex.com>  Sun, 14 Sep 2014 23:53:03 +0000
+
 model-builder (0.4.1-6.1) unstable; urgency=low
 
   * Non-maintainer upload.
diff -Nru model-builder-0.4.1/debian/control model-builder-0.4.1/debian/control
--- model-builder-0.4.1/debian/control	2013-06-01 08:50:05.000000000 -0300
+++ model-builder-0.4.1/debian/control	2014-09-14 20:45:27.000000000 -0300
@@ -12,7 +12,7 @@
 Package: model-builder
 Architecture: all
 Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends},
- python-numpy, python-scipy, python-wxtools, python-wxgtk2.8,
+ python-numpy, python-scipy, python-wxtools, python-wxgtk3.0,
  python-matplotlib, python-pkg-resources
 Description: graphical ODE simulator
  Model Builder is a graphical tool for designing, simulating and
diff -Nru model-builder-0.4.1/debian/patches/series model-builder-0.4.1/debian/patches/series
--- model-builder-0.4.1/debian/patches/series	2010-07-16 23:30:58.000000000 -0300
+++ model-builder-0.4.1/debian/patches/series	2014-09-14 20:47:20.000000000 -0300
@@ -3,3 +3,4 @@
 MB_help_path.diff
 desktop_file.diff
 use_wx2.8.diff
+wxpython3.0.patch
diff -Nru model-builder-0.4.1/debian/patches/wxpython3.0.patch model-builder-0.4.1/debian/patches/wxpython3.0.patch
--- model-builder-0.4.1/debian/patches/wxpython3.0.patch	1969-12-31 21:00:00.000000000 -0300
+++ model-builder-0.4.1/debian/patches/wxpython3.0.patch	2014-09-14 20:52:49.000000000 -0300
@@ -0,0 +1,266 @@
+Description: Update for wxPython 3.0
+ These changes should remain compatible with wxPython 2.8.
+Bug-Debian: https://bugs.debian.org/759066
+Forwarded: no
+Last-Update: 2014-09-14
+
+--- model-builder-0.4.1.orig/model_builder/PlotFigure.py
++++ model-builder-0.4.1/model_builder/PlotFigure.py
+@@ -30,7 +30,7 @@ from numpy.random import *
+ from numpy import *
+ 
+ import wxversion
+-wxversion.select('2.8')
++wxversion.select('3.0')
+ import wx
+ 
+ def create(parent):
+@@ -318,7 +318,7 @@ class PlotFigure(wx.Frame):
+         return self.toolbar
+ 
+ if __name__ == '__main__':
+-    app = wx.PySimpleApp()
++    app = wx.App(False)
+     frame = create(None)
+     x = normal(0,1,50)
+     y = normal(0,1,(50,5))
+--- model-builder-0.4.1.orig/model_builder/PyMB.py
++++ model-builder-0.4.1/model_builder/PyMB.py
+@@ -27,7 +27,7 @@
+ #-----------------------------------------------------------------------------
+ 
+ import wxversion
+-wxversion.select('2.8')
++wxversion.select('3.0')
+ import wx
+ import wxFrame1
+ 
+@@ -52,7 +52,6 @@ modules ={u'MB': [0, '', u'MB.hhp'],
+ 
+ class BoaApp(wx.App):
+     def OnInit(self):
+-        wx.InitAllImageHandlers()
+         self.main = wxFrame1.create(None)
+         # needed when running from Boa under Windows 9X
+         self.SetTopWindow(self.main)
+--- model-builder-0.4.1.orig/model_builder/about.py
++++ model-builder-0.4.1/model_builder/about.py
+@@ -1,6 +1,6 @@
+ #Boa:Dialog:wxDialog1
+ import wxversion
+-wxversion.select('2.8')
++wxversion.select('3.0')
+ import wx
+ import wx.html
+ import webbrowser
+--- model-builder-0.4.1.orig/model_builder/icones.py
++++ model-builder-0.4.1/model_builder/icones.py
+@@ -3,7 +3,7 @@
+ # This file was generated by /usr/bin/img2py-2.6
+ #
+ import wxversion
+-wxversion.select('2.8') 
++wxversion.select('3.0') 
+ from wx import ImageFromStream, BitmapFromImage
+ import cStringIO, zlib
+ 
+--- model-builder-0.4.1.orig/model_builder/lhsframe.py
++++ model-builder-0.4.1/model_builder/lhsframe.py
+@@ -12,7 +12,7 @@
+ # New field:   Whatever
+ #-----------------------------------------------------------------------------
+ import wxversion
+-wxversion.select('2.8')
++wxversion.select('3.0')
+ import wx
+ import os,cPickle
+ from Bayes import lhs, Melding as meld
+@@ -269,6 +269,6 @@ class LHS(wxFrame):
+         return data
+ 
+ if __name__ == '__main__':
+-    app = wx.PySimpleApp()
++    app = wx.App(False)
+     LHS(None).Show()
+     app.MainLoop()
+--- model-builder-0.4.1.orig/model_builder/lhsframe_glade.py
++++ model-builder-0.4.1/model_builder/lhsframe_glade.py
+@@ -2,7 +2,7 @@
+ # -*- coding: ISO-8859-1 -*-
+ # generated by wxGlade 0.3.5.1 on Thu Aug 31 11:12:37 2006
+ import wxversion
+-wxversion.select('2.8') 
++wxversion.select('3.0') 
+ import wx
+ import wx.grid
+ 
+@@ -134,6 +134,6 @@ class wxFrame(wx.Frame):
+ 
+ 
+ if __name__ == '__main__':
+-    app = wx.PySimpleApp()
++    app = wx.App(False)
+     wxFrame(None).Show()
+     app.MainLoop()
+--- model-builder-0.4.1.orig/model_builder/odexml.py
++++ model-builder-0.4.1/model_builder/odexml.py
+@@ -13,7 +13,7 @@
+ from xml.dom import minidom, Node
+ import __version__ as V
+ import wxversion
+-wxversion.select('2.8')
++wxversion.select('3.0')
+ import wx, sys, os
+ from numpy import array
+ 
+--- model-builder-0.4.1.orig/model_builder/quivVarFrame.py
++++ model-builder-0.4.1/model_builder/quivVarFrame.py
+@@ -12,7 +12,7 @@
+ #-----------------------------------------------------------------------------
+ #Boa:MiniFrame:quivVarFrame
+ import wxversion
+-wxversion.select('2.8')
++wxversion.select('3.0')
+ import wx
+ import wx.lib.buttons
+ import PlotFigure as PF
+@@ -74,7 +74,7 @@ class quivVarFrame(wx.MiniFrame):
+               label='Trajectory Plot', name='trajBox', parent=self,
+               pos=wx.Point(16, 120), size=wx.Size(304, 112), style=0)
+         self.trajBox.SetMinSize(wx.Size(304, 130))
+-        self.trajBox.SetBestFittingSize(wx.Size(304, 112))
++        self.trajBox.SetInitialSize(wx.Size(304, 112))
+ 
+         self.drawTrajCheck = wx.CheckBox(id=wxID_QUIVVARFRAMEDRAWTRAJCHECK,
+               label='Draw trajectory', name='drawTrajCheck', parent=self,
+@@ -241,8 +241,7 @@ class quivVarFrame(wx.MiniFrame):
+ 
+ 
+ if __name__ == '__main__':
+-    app = wx.PySimpleApp()
+-    wx.InitAllImageHandlers()
++    app = wx.App(False)
+     frame = create(None)
+     frame.Show()
+ 
+--- model-builder-0.4.1.orig/model_builder/uncertaintyMiniFrame.py
++++ model-builder-0.4.1/model_builder/uncertaintyMiniFrame.py
+@@ -25,7 +25,7 @@
+ #-----------------------------------------------------------------------------
+ #Boa:MiniFrame:uncertaintyMiniFrame
+ import wxversion
+-wxversion.select('2.8')
++wxversion.select('3.0')
+ import wx
+ import wx.gizmos
+ from Numeric import *
+@@ -235,7 +235,7 @@ class uncertaintyMiniFrame(wx.MiniFrame)
+         self.statusPanel.AppendText('Done!\n\n')
+         if not self.likList.GetLineText(0) =='': #read datafile
+             self.statusPanel.AppendText('Reading data from file...\n')
+-            dlg = wx.FileDialog(self, "Open data file", ".", "", "*.txt", wx.OPEN)
++            dlg = wx.FileDialog(self, "Open data file", ".", "", "*.txt", wx.FD_OPEN)
+             try:
+                 if dlg.ShowModal() == wx.ID_OK:
+                     filename = dlg.GetPath()
+--- model-builder-0.4.1.orig/model_builder/wxFrame1.py
++++ model-builder-0.4.1/model_builder/wxFrame1.py
+@@ -26,7 +26,7 @@
+ #Boa:Frame:wxFrame1
+ from __future__ import division
+ import wxversion
+-wxversion.select('2.8')
++wxversion.select('3.0')
+ import wx
+ import wx.stc
+ #from Numeric import *
+@@ -319,7 +319,7 @@ class wxFrame1(wx.Frame):
+         self.SetMenuBar(self.menuBar1)
+         self.SetToolTipString('Model Builder')
+         self.SetAutoLayout(True)
+-        self.SetBestFittingSize(wx.Size(730, 480))
++        self.SetInitialSize(wx.Size(730, 480))
+         self.SetMaxSize(wx.Size(730, 480))
+         self.SetIcon(wx.Icon('/usr/share/pixmaps/MB.ico',wx.BITMAP_TYPE_ICO))
+         self.Bind(wx.EVT_CLOSE, self.OnWxFrame1Close)
+@@ -346,7 +346,7 @@ class wxFrame1(wx.Frame):
+               name='initValInput', parent=self.panel1, pos=wx.Point(0, 208),
+               size=wx.Size(465, 22), style=0, value='')
+         self.initValInput.SetToolTipString('Initial conditions: values separated by spaces.')
+-        self.initValInput.SetBestFittingSize(wx.Size(465, 22))
++        self.initValInput.SetInitialSize(wx.Size(465, 22))
+ 
+         self.startText = wx.StaticText(id=wxID_WXFRAME1STARTTEXT,
+               label='Start time:', name='startText', parent=self.panel1,
+@@ -412,7 +412,7 @@ class wxFrame1(wx.Frame):
+         self.separaLine = wx.StaticLine(id=wxID_WXFRAME1SEPARALINE,
+               name='separaLine', parent=self.panel1, pos=wx.Point(477, 0),
+               size=wx.Size(30, 780),
+-              style=wx.MAXIMIZE_BOX | wx.LI_VERTICAL | wx.THICK_FRAME | wx.LI_VERTICAL| 1)
++              style=wx.MAXIMIZE_BOX | wx.LI_VERTICAL | wx.RESIZE_BORDER | wx.LI_VERTICAL | wx.CENTRE)
+         self.separaLine.SetBackgroundColour(wx.Colour(0, 0, 0))
+         self.separaLine.SetToolTipString('')
+         self.separaLine.SetThemeEnabled(True)
+@@ -457,12 +457,12 @@ class wxFrame1(wx.Frame):
+               parent=self.panel1, pos=wx.Point(0, 0), size=wx.Size(465, 22),
+               style=0)
+         self.eqText.SetThemeEnabled(True)
+-        self.eqText.SetBestFittingSize(wx.Size(465, 22))
++        self.eqText.SetInitialSize(wx.Size(465, 22))
+ 
+         self.initValText = wx.StaticText(id=wxID_WXFRAME1INITVALTEXT,
+               label='Initial values:', name='initValText', parent=self.panel1,
+               pos=wx.Point(0, 184), size=wx.Size(465, 22), style=0)
+-        self.initValText.SetBestFittingSize(wx.Size(465, 22))
++        self.initValText.SetInitialSize(wx.Size(465, 22))
+ 
+         self.minStepText = wx.StaticText(id=wxID_WXFRAME1MINSTEPTEXT,
+               label='Min. Step Size:', name='minStepText', parent=self.panel1,
+@@ -509,7 +509,7 @@ class wxFrame1(wx.Frame):
+         self.modtree = Model() #reset the modtree object upon the opening of a new model
+         if self.curdir:
+             os.chdir(self.curdir)
+-        dlg = wx.FileDialog(self, "Choose a file", self.curdir, "", "*.ode", wx.OPEN)
++        dlg = wx.FileDialog(self, "Choose a file", self.curdir, "", "*.ode", wx.FD_OPEN)
+         try:
+             if dlg.ShowModal() == wx.ID_OK:
+                 filename = dlg.GetPath()
+@@ -604,7 +604,7 @@ class wxFrame1(wx.Frame):
+         Save as menu entry
+         """
+         self.modtree = Model()
+-        dlg = wx.FileDialog(self, "Save File As", self.curdir, "", "*.ode", wx.SAVE)
++        dlg = wx.FileDialog(self, "Save File As", self.curdir, "", "*.ode", wx.FD_SAVE)
+         try:
+             if dlg.ShowModal() == wx.ID_OK:
+                 self.FileName = dlg.GetPath()
+--- model-builder-0.4.1.orig/model_builder/wxFrame2.py
++++ model-builder-0.4.1/model_builder/wxFrame2.py
+@@ -25,7 +25,7 @@
+ #Boa:Frame:wxFrame2
+ 
+ import wxversion
+-wxversion.select('2.8')
++wxversion.select('3.0')
+ import wx
+ import wx.grid
+ from numpy import *
+@@ -147,7 +147,7 @@ class wxFrame2(wx.Frame):
+         self.filename = None
+ 
+     def OnToolbar1tools0Tool(self, event):
+-        dlg = wx.FileDialog(self, "Save Data As", ".", "", "*.dat", wx.SAVE)
++        dlg = wx.FileDialog(self, "Save Data As", ".", "", "*.dat", wx.FD_SAVE)
+         try:
+             if dlg.ShowModal() == wx.ID_OK:
+                 filename = dlg.GetPath()
+@@ -294,8 +294,7 @@ class TableBase(wx.grid.PyGridTableBase)
+         self.collabels[col]= label
+ 
+ if __name__ == '__main__':
+-    app = wx.PySimpleApp()
+-    wx.InitAllImageHandlers()
++    app = wx.App(False)
+     frame = create(None)
+     frame.Show()
+ 

Reply via email to