Control: tags 758939 + patch Control: severity -1 serious # Justification: blocks the on-going wxpython3.0 transition
I've rebuilt mayavi2 with the attached patch. Provided I used a patched version of python-traitsui, it seems to work well: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=758695#19 Please let me know if you'd like me to NMU these changes. Cheers, Olly
diff -Nru mayavi2-4.3.1/debian/changelog mayavi2-4.3.1/debian/changelog --- mayavi2-4.3.1/debian/changelog 2014-06-17 18:37:54.000000000 +1200 +++ mayavi2-4.3.1/debian/changelog 2014-09-20 13:14:22.000000000 +1200 @@ -1,3 +1,11 @@ +mayavi2 (4.3.1-3.1) unstable; urgency=medium + + * Non-maintainer upload. + * Update for wxpython3.0 (Closes: #758939): + + New patch: wxpy3.0-compat.patch + + -- Olly Betts <o...@survex.com> Sat, 20 Sep 2014 01:14:20 +0000 + mayavi2 (4.3.1-3) unstable; urgency=medium * d/rules: remove references to pyshared (Closes: #746762) diff -Nru mayavi2-4.3.1/debian/control mayavi2-4.3.1/debian/control --- mayavi2-4.3.1/debian/control 2014-03-16 17:06:34.000000000 +1300 +++ mayavi2-4.3.1/debian/control 2014-09-01 05:59:14.000000000 +1200 @@ -14,7 +14,7 @@ Package: mayavi2 Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, - python-traits, python-traitsui, python-wxgtk2.8, python-numpy, + python-traits, python-traitsui, python-wxgtk3.0, python-numpy, python-vtk (>= 5.4.2-5), python-pkg-resources, python-envisage, python-apptools (>= 4.0.0-1), libjs-jquery, python-configobj Suggests: python-scipy, ipython diff -Nru mayavi2-4.3.1/debian/patches/ipython.diff mayavi2-4.3.1/debian/patches/ipython.diff --- mayavi2-4.3.1/debian/patches/ipython.diff 2011-12-08 22:06:41.000000000 +1300 +++ mayavi2-4.3.1/debian/patches/ipython.diff 2014-09-20 12:49:41.000000000 +1200 @@ -1,8 +1,8 @@ -Index: mayavi2-4.0.0/mayavi/tests/README.txt +Index: mayavi2-4.3.1/mayavi/tests/README.txt =================================================================== ---- mayavi2-4.0.0.orig/mayavi/tests/README.txt 2011-12-08 03:55:09.000000000 -0500 -+++ mayavi2-4.0.0/mayavi/tests/README.txt 2011-12-08 03:55:36.000000000 -0500 -@@ -47,7 +47,6 @@ +--- mayavi2-4.3.1.orig/mayavi/tests/README.txt ++++ mayavi2-4.3.1/mayavi/tests/README.txt +@@ -47,7 +47,6 @@ The IPython Shell can be embedded anywhe You need to import the `IPython` module and then add the following lines wherver you want to embed the shell:: diff -Nru mayavi2-4.3.1/debian/patches/series mayavi2-4.3.1/debian/patches/series --- mayavi2-4.3.1/debian/patches/series 2011-12-09 17:32:05.000000000 +1300 +++ mayavi2-4.3.1/debian/patches/series 2014-09-01 06:01:52.000000000 +1200 @@ -1,2 +1,3 @@ help.diff ipython.diff +wxpy3.0-compat.patch diff -Nru mayavi2-4.3.1/debian/patches/wxpy3.0-compat.patch mayavi2-4.3.1/debian/patches/wxpy3.0-compat.patch --- mayavi2-4.3.1/debian/patches/wxpy3.0-compat.patch 1970-01-01 12:00:00.000000000 +1200 +++ mayavi2-4.3.1/debian/patches/wxpy3.0-compat.patch 2014-09-20 13:13:56.000000000 +1200 @@ -0,0 +1,127 @@ +Description: Fixes for wxPython 3.0 + Retains compatibility with 2.8 - there wx.InitAllImageHandlers() is a no-op, + wx.HIDE_READONLY is 0, and wx.PySimpleApp() issues a deprecation warning. +Author: Olly Betts <o...@survex.com> +Bug-Debian: https://bugs.debian.org/758939 +Forwarded: no +Last-Update: 2014-09-20 + +Index: mayavi2-4.3.1/tvtk/pyface/ui/wx/init.py +=================================================================== +--- mayavi2-4.3.1.orig/tvtk/pyface/ui/wx/init.py ++++ mayavi2-4.3.1/tvtk/pyface/ui/wx/init.py +@@ -22,10 +22,6 @@ if wx.VERSION < (2, 6): + _app = wx.GetApp() + + if _app is None: +- _app = wx.PySimpleApp() ++ _app = wx.App(False) +- +- # Before we can load any images we have to initialize wxPython's image +- # handlers. +- wx.InitAllImageHandlers() + + #### EOF ###################################################################### +Index: mayavi2-4.3.1/tvtk/util/wx_gradient_editor.py +=================================================================== +--- mayavi2-4.3.1.orig/tvtk/util/wx_gradient_editor.py ++++ mayavi2-4.3.1/tvtk/util/wx_gradient_editor.py +@@ -392,7 +392,7 @@ class wxGradientEditorWidget(wx.Panel, G + (lookuptable) ``*.grad`` (gradient table for use with this program), + and ``*.jpg`` (image of the gradient) + """ +- dlg = wx.FileDialog(self, "Save LUT to...", style=wx.SAVE) ++ dlg = wx.FileDialog(self, "Save LUT to...", style=wx.FD_SAVE) + wildcard = "Gradient Files (.grad)|*.grad|" \ + "All files (*.*)|*.*" + dlg.SetWildcard(wildcard) +@@ -405,7 +405,7 @@ class wxGradientEditorWidget(wx.Panel, G + """ + Load a ``*.grad`` lookuptable file using wxpython dialog + """ +- style = wx.OPEN | wx.HIDE_READONLY ++ style = wx.FD_OPEN + dlg = wx.FileDialog(self, "Open a file", style=style) + wildcard = "Gradient Files (.grad)|*.grad|" \ + "All files (*.*)|*.*" +@@ -510,7 +510,7 @@ def main(): + """If we had a vtk window running, update it here""" + print("Update Render Window") + +- app = wx.PySimpleApp() ++ app = wx.App(False) + editor = wxGradientEditor(table, + on_color_table_changed, + colors=['rgb', 'a', 'h', 's', 'v'], +Index: mayavi2-4.3.1/docs/source/mayavi/auto/wx_embedding.py +=================================================================== +--- mayavi2-4.3.1.orig/docs/source/mayavi/auto/wx_embedding.py ++++ mayavi2-4.3.1/docs/source/mayavi/auto/wx_embedding.py +@@ -60,7 +60,7 @@ class MainWindow(wx.Frame): + kind='subpanel').control + self.Show(True) + +-app = wx.PySimpleApp() ++app = wx.App(False) + frame = MainWindow(None, wx.ID_ANY) + app.MainLoop() + +Index: mayavi2-4.3.1/docs/source/mayavi/auto/wx_mayavi_embed_in_notebook.py +=================================================================== +--- mayavi2-4.3.1.orig/docs/source/mayavi/auto/wx_mayavi_embed_in_notebook.py ++++ mayavi2-4.3.1/docs/source/mayavi/auto/wx_mayavi_embed_in_notebook.py +@@ -80,6 +80,6 @@ class MainWindow(wx.Frame): + self.Show(True) + + if __name__ == '__main__': +- app = wx.PySimpleApp() ++ app = wx.App(False) + frame = MainWindow(None, wx.ID_ANY) + app.MainLoop() +Index: mayavi2-4.3.1/examples/mayavi/interactive/wx_embedding.py +=================================================================== +--- mayavi2-4.3.1.orig/examples/mayavi/interactive/wx_embedding.py ++++ mayavi2-4.3.1/examples/mayavi/interactive/wx_embedding.py +@@ -60,7 +60,7 @@ class MainWindow(wx.Frame): + kind='subpanel').control + self.Show(True) + +-app = wx.PySimpleApp() ++app = wx.App(False) + frame = MainWindow(None, wx.ID_ANY) + app.MainLoop() + +Index: mayavi2-4.3.1/examples/mayavi/interactive/wx_mayavi_embed_in_notebook.py +=================================================================== +--- mayavi2-4.3.1.orig/examples/mayavi/interactive/wx_mayavi_embed_in_notebook.py ++++ mayavi2-4.3.1/examples/mayavi/interactive/wx_mayavi_embed_in_notebook.py +@@ -80,6 +80,6 @@ class MainWindow(wx.Frame): + self.Show(True) + + if __name__ == '__main__': +- app = wx.PySimpleApp() ++ app = wx.App(False) + frame = MainWindow(None, wx.ID_ANY) + app.MainLoop() +Index: mayavi2-4.3.1/tvtk/pyface/ui/wx/wxVTKRenderWindowInteractor.py +=================================================================== +--- mayavi2-4.3.1.orig/tvtk/pyface/ui/wx/wxVTKRenderWindowInteractor.py ++++ mayavi2-4.3.1/tvtk/pyface/ui/wx/wxVTKRenderWindowInteractor.py +@@ -21,7 +21,7 @@ Creation: + + wxVTKRenderWindowInteractor(parent, ID, stereo=0, [wx keywords]): + +- You should create a wx.PySimpleApp() or some other wx**App before ++ You should create a wx.App(False) or some other wx.App subclass before + creating the window. + + Behaviour: +@@ -695,7 +695,7 @@ def wxVTKRenderWindowInteractorConeExamp + """Like it says, just a simple example + """ + # every wx app needs an app +- app = wx.PySimpleApp() ++ app = wx.App(False) + + # create the top-level frame, sizer and wxVTKRWI + frame = wx.Frame(None, -1, "wxVTKRenderWindowInteractor", size=(400,400))