Control: tags 757313 + pending

Dear maintainer,

The attached patch updates python-pyface to use wxpython3.0, fixes some
deprecation warnings I saw testing some of the packages which use
python-pyface, and updates some constants to use preferred new names.

It would be good to get this update into unstable to aid testing the reverse
dependencies.

Let me know if you'd like me to NMU this change.

Cheers,
    Olly
diff -Nru python-pyface-4.4.0/debian/changelog python-pyface-4.4.0/debian/changelog
--- python-pyface-4.4.0/debian/changelog	2014-07-06 17:19:24.000000000 -0300
+++ python-pyface-4.4.0/debian/changelog	2014-08-31 16:25:39.000000000 -0300
@@ -1,3 +1,11 @@
+python-pyface (4.4.0-1.2) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Update for wxpython3.0 (Closes: #757313):
+    + New patch: wxpy3.0-compat.patch
+
+ -- Olly Betts <o...@survex.com>  Sun, 31 Aug 2014 19:09:23 +0000
+
 python-pyface (4.4.0-1.1) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -Nru python-pyface-4.4.0/debian/control python-pyface-4.4.0/debian/control
--- python-pyface-4.4.0/debian/control	2014-03-16 00:44:34.000000000 -0300
+++ python-pyface-4.4.0/debian/control	2014-08-07 02:10:41.000000000 -0300
@@ -13,7 +13,7 @@
 
 Package: python-pyface
 Architecture: all
-Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, python-wxgtk2.8, python-qt4
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, python-wxgtk3.0, python-qt4
 Breaks: python-traitsbackendqt, python-traitsbackendwx
 Replaces: python-traitsbackendqt, python-traitsbackendwx
 Description: traits-capable windowing framework
diff -Nru python-pyface-4.4.0/debian/patches/series python-pyface-4.4.0/debian/patches/series
--- python-pyface-4.4.0/debian/patches/series	1969-12-31 21:00:00.000000000 -0300
+++ python-pyface-4.4.0/debian/patches/series	2014-08-15 07:54:32.000000000 -0300
@@ -0,0 +1 @@
+wxpy3.0-compat.patch
diff -Nru python-pyface-4.4.0/debian/patches/wxpy3.0-compat.patch python-pyface-4.4.0/debian/patches/wxpy3.0-compat.patch
--- python-pyface-4.4.0/debian/patches/wxpy3.0-compat.patch	1969-12-31 21:00:00.000000000 -0300
+++ python-pyface-4.4.0/debian/patches/wxpy3.0-compat.patch	2014-08-31 16:36:09.000000000 -0300
@@ -0,0 +1,116 @@
+Description: Updates for wxPython 3.0
+ These changes should maintain compatibility with wxPython 2.8.
+Author: Olly Betts <o...@survex.com>
+Forwarded: no
+Last-Update: 2014-08-15
+
+Index: python-pyface-4.4.0/pyface/ui/wx/directory_dialog.py
+===================================================================
+--- python-pyface-4.4.0.orig/pyface/ui/wx/directory_dialog.py
++++ python-pyface-4.4.0/pyface/ui/wx/directory_dialog.py
+@@ -70,7 +70,7 @@ class DirectoryDialog(MDirectoryDialog,
+ 
+     def _create_control(self, parent):
+         # The default style.
+-        style = wx.OPEN
++        style = 0
+ 
+         # Create the wx style depending on which buttons are required etc.
+         if self.new_directory:
+Index: python-pyface-4.4.0/pyface/ui/wx/file_dialog.py
+===================================================================
+--- python-pyface-4.4.0.orig/pyface/ui/wx/file_dialog.py
++++ python-pyface-4.4.0/pyface/ui/wx/file_dialog.py
+@@ -105,11 +105,11 @@ class FileDialog(MFileDialog, Dialog):
+             default_filename = self.default_filename
+ 
+         if self.action == 'open':
+-            style = wx.OPEN
++            style = wx.FD_OPEN
+         elif self.action == 'open files':
+-            style = wx.OPEN | wx.MULTIPLE
++            style = wx.FD_OPEN | wx.FD_MULTIPLE
+         else:
+-            style = wx.SAVE | wx.OVERWRITE_PROMPT
++            style = wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT
+ 
+         # Create the actual dialog.
+         dialog = wx.FileDialog(parent, self.title, defaultDir=default_directory,
+Index: python-pyface-4.4.0/pyface/ui/wx/init.py
+===================================================================
+--- python-pyface-4.4.0.orig/pyface/ui/wx/init.py
++++ python-pyface-4.4.0/pyface/ui/wx/init.py
+@@ -15,17 +15,17 @@ import wx
+ 
+ 
+ # Check the version number is late enough.
+-if wx.VERSION < (2, 6):
+-    raise RuntimeError, "Need wx version 2.6 or higher, but got %s" % str(wx.VERSION)
++if wx.VERSION < (2, 8):
++    raise RuntimeError, "Need wx version 2.8 or higher, but got %s" % str(wx.VERSION)
+ 
+ # It's possible that it has already been initialised.
+ _app = wx.GetApp()
+ 
+ if _app is None:
+-    _app = wx.PySimpleApp()
+-
+-    # Before we can load any images we have to initialize wxPython's image
+-    # handlers.
+-    wx.InitAllImageHandlers()
++    # wx.PySimpleApp() is deprecated in wx3.0, but this is all it really does:
++    class PySimpleApp(wx.App):
++        def OnInit(self):
++            return True
++    _app = PySimpleApp()
+ 
+ #### EOF ######################################################################
+Index: python-pyface-4.4.0/pyface/wx/dialog.py
+===================================================================
+--- python-pyface-4.4.0.orig/pyface/wx/dialog.py
++++ python-pyface-4.4.0/pyface/wx/dialog.py
+@@ -36,7 +36,7 @@ class OpenFileDialog(wx.FileDialog):
+     def __init__(self, parent=None, **kw):
+         """ Constructor. """
+ 
+-        style = wx.OPEN | wx.HIDE_READONLY
++        style = wx.FD_OPEN
+ 
+         # Base-class constructor.
+         wx.FileDialog.__init__(self, parent, "Open", style=style, **kw)
+@@ -49,7 +49,7 @@ class OpenDirDialog(wx.DirDialog):
+     def __init__(self, parent=None, **kw):
+         """ Constructor. """
+ 
+-        style = wx.OPEN | wx.HIDE_READONLY | wx.DD_NEW_DIR_BUTTON
++        style = wx.DD_NEW_DIR_BUTTON
+ 
+         # Base-class constructor.
+         wx.DirDialog.__init__(self, parent, "Open", style=style, **kw)
+@@ -62,7 +62,7 @@ class SaveFileAsDialog(wx.FileDialog):
+     def __init__(self, parent=None, **kw):
+         """ Constructor. """
+ 
+-        style = wx.SAVE | wx.OVERWRITE_PROMPT
++        style = wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT
+ 
+         # Base-class constructor.
+         wx.FileDialog.__init__(self, parent, "Save As", style=style, **kw)
+Index: python-pyface-4.4.0/pyface/util/guisupport.py
+===================================================================
+--- python-pyface-4.4.0.orig/pyface/util/guisupport.py
++++ python-pyface-4.4.0/pyface/util/guisupport.py
+@@ -81,7 +81,12 @@ def get_app_wx(*args, **kwargs):
+     if app is None:
+         if not kwargs.has_key('redirect'):
+             kwargs['redirect'] = False
+-        app = wx.PySimpleApp(*args, **kwargs)
++        # wx.PySimpleApp() is deprecated in wx3.0, but this is all it really
++        # does:
++        class PySimpleApp(wx.App):
++            def OnInit(self):
++                return True
++        app = PySimpleApp(*args, **kwargs)
+     return app
+ 
+ def is_event_loop_running_wx(app=None):

Reply via email to