Hi Olly,

Here's an updated debdiff with an updated patch for wxPython 3.0 support for congruity. I also added in a trivial fix for the other open bug too - I hope that is OK.

A couple of lessons learned that you may want to include in your README for wxPython 3 porting (unfortunately I don't think these can be automated in your script):

a) In a couple of places we were calling wx.Sizer.Remove(wx.Window). This worked in 2.8 but it seems it now does not. We should have instead be using wx.Sizer.Detach(wx.Window)

b) SetSize() no longer does exactly the same thing that it did on 2.8. We had to call SetClientSize() instead to get the same behavior as we had in 2.8.

c) wx.App(False) can be used in place of wx.PySimpleApp.

Thanks,
Scott
diff -Nru congruity-18/debian/changelog congruity-18/debian/changelog
--- congruity-18/debian/changelog       2014-04-23 20:32:11.000000000 -0400
+++ congruity-18/debian/changelog       2014-09-10 20:36:55.000000000 -0400
@@ -1,3 +1,12 @@
+congruity (18-1.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Update for wxPython 3.0 (Closes: #759045):
+    - New patch: wxpython3.0.patch
+  * Fix typo in mime-type file (Closes: #747396)
+
+ -- Olly Betts <o...@survex.com>  Sat, 06 Sep 2014 00:56:45 +0000
+
 congruity (18-1) unstable; urgency=medium
 
   * New upstream release (Closes: #743050)
diff -Nru congruity-18/debian/control congruity-18/debian/control
--- congruity-18/debian/control 2014-04-23 20:31:06.000000000 -0400
+++ congruity-18/debian/control 2014-09-10 20:17:23.000000000 -0400
@@ -11,7 +11,7 @@
 Depends: python, python (>= 2.5) | python-ctypes,
        python-libconcord (>= 1.0),
        python-suds,
-       python-wxgtk2.8,
+       python-wxgtk3.0,
        shared-mime-info,
        ${misc:Depends}
 Description: graphical utility to configure Logitech Harmony remotes
diff -Nru congruity-18/debian/mime congruity-18/debian/mime
--- congruity-18/debian/mime    2014-04-23 20:16:53.000000000 -0400
+++ congruity-18/debian/mime    2014-09-10 20:34:41.000000000 -0400
@@ -1,3 +1,3 @@
-application/application/x-easyzapper-hex; congruity '%s'
+application/x-easyzapper-hex; congruity '%s'
 application/x-easyzapper-upgrade;; congruity '%s'
 application/x-easyzapper-tutor; congruity '%s'
diff -Nru congruity-18/debian/patches/series congruity-18/debian/patches/series
--- congruity-18/debian/patches/series  1969-12-31 19:00:00.000000000 -0500
+++ congruity-18/debian/patches/series  2014-09-10 20:17:23.000000000 -0400
@@ -0,0 +1 @@
+wxpython3.0.patch
diff -Nru congruity-18/debian/patches/wxpython3.0.patch 
congruity-18/debian/patches/wxpython3.0.patch
--- congruity-18/debian/patches/wxpython3.0.patch       1969-12-31 
19:00:00.000000000 -0500
+++ congruity-18/debian/patches/wxpython3.0.patch       2014-09-10 
20:29:38.000000000 -0400
@@ -0,0 +1,162 @@
+commit 28f785f3509969bae614cc6584200e1362a4c249
+Author: Scott Talbert <s...@techie.net>
+Date:   Wed Sep 10 20:01:25 2014 -0400
+
+    Support wxPython 3.0
+
+Origin: upstream, 
http://sourceforge.net/p/congruity/code/ci/28f785f3509969bae614cc6584200e1362a4c249/
+Bug-Debian: https://bugs.debian.org/759045
+
+diff --git a/congruity b/congruity
+index 3ba1844..54c6783 100755
+--- a/congruity
++++ b/congruity
+@@ -38,7 +38,7 @@ try:
+     import libconcord
+ except:
+     str = traceback.format_exc()
+-    app = wx.PySimpleApp()
++    app = wx.App(False)
+     dlg = wx.MessageDialog(
+         None,
+         "Could not load libconcord; please ensure it, and the Python "
+@@ -54,7 +54,7 @@ try:
+     libconcord.update_configuration
+ except:
+     str = traceback.format_exc()
+-    app = wx.PySimpleApp()
++    app = wx.App(False)
+     dlg = wx.MessageDialog(
+         None,
+         "Could not load the correct version of libconcord; please ensure "
+@@ -225,6 +225,7 @@ class DecoratedContainer(wx.Panel):
+         wx.Panel.__init__(self, parent)
+ 
+         self.sizer = wx.GridBagSizer(5, 5)
++        self.sizer.SetCols(3)
+         self.sizer.AddGrowableCol(2)
+         self.SetSizer(self.sizer)
+ 
+@@ -1577,7 +1578,7 @@ class Wizard(wx.Dialog):
+         resources,
+         app_finalizer,
+         min_page_width = 658,
+-        min_page_height = 550
++        min_page_height = 560
+     ):
+         self.app_finalizer = app_finalizer
+ 
+@@ -1652,7 +1653,7 @@ class Wizard(wx.Dialog):
+             size_page = self.GetSizeTuple()
+             size_wiz = tuple_max(size_wiz, size_page)
+             page.Hide()
+-            self.sizer_top_right.Remove(page)
++            self.sizer_top_right.Detach(page)
+ 
+         if self.min_page_width and (size_wiz[0] < self.min_page_width):
+             size_wiz = (self.min_page_width, size_wiz[1])
+@@ -1660,7 +1661,7 @@ class Wizard(wx.Dialog):
+         if self.min_page_height and (size_wiz[1] < self.min_page_height):
+             size_wiz = (size_wiz[0], self.min_page_height )
+ 
+-        self.SetSize(size_wiz)
++        self.SetClientSize(size_wiz)
+ 
+     def SetInitialPage(self, page):
+         if self.cur_page:
+@@ -1711,7 +1712,7 @@ class Wizard(wx.Dialog):
+             prev_page = self.cur_page
+             if prev_page:
+                 prev_page.Hide()
+-                self.sizer_top_right.Remove(prev_page)
++                self.sizer_top_right.Detach(prev_page)
+ 
+             self.cur_page = page
+ 
+@@ -1874,8 +1875,7 @@ def main(argv):
+         ezhex_filename = None
+         initial_exception = ("Command-line error", exception_message())
+ 
+-    app = wx.PySimpleApp()
+-    wx.InitAllImageHandlers()
++    app = wx.App(False)
+ 
+     resources = Resources(appdir, no_web)
+     resources.LoadImages()
+diff --git a/mhgui b/mhgui
+index 1c8746d..66c7413 100755
+--- a/mhgui
++++ b/mhgui
+@@ -53,7 +53,7 @@ try:
+     import libconcord
+ except:
+     str = traceback.format_exc()
+-    app = wx.PySimpleApp()
++    app = wx.App(False)
+     dlg = wx.MessageDialog(
+         None,
+         "Could not load libconcord; please ensure it, and the Python "
+@@ -84,15 +84,15 @@ class ThrobberDialog(wx.Dialog):
+             self.title = self.TITLE_WEBSITE
+         else:
+             self.title = title
+-        wx.Dialog.__init__(self, None, -1, size=(256, 256), title=self.title)
++        wx.Dialog.__init__(self, None, -1, title=self.title)
++        self.SetClientSize((256, 256))
+         self.SetBackgroundColour("white")
+         self.gif = wx.animate.GIFAnimationCtrl(self, -1,
+                                                self.FindGif("throbber.gif"))
+         self.gif.GetPlayer().UseBackgroundColour(True)
+         self.gif.Play()
+         self.sizer = wx.BoxSizer(wx.VERTICAL)
+-        self.sizer.AddSpacer(64)
+-        self.sizer.Add(self.gif, 0, wx.ALIGN_CENTER_HORIZONTAL)
++        self.sizer.Add(self.gif, 1, wx.EXPAND|wx.ALL, 64)
+         self.SetSizer(self.sizer)
+     def FindGif(self, filename):
+         appdir = os.path.abspath(os.path.dirname(sys.argv[0]))
+@@ -1549,6 +1549,7 @@ class FavoriteChannelsPanel(WizardPanelBase):
+                 if button.ButtonType == "FavoriteChannelButton":
+                     self.remoteButtonsList.append(button.ButtonKey)
+             self.remoteButtonsListBox.Set(self.remoteButtonsList)
++        self.Fit()
+         self.parent.Show()
+ 
+     def OnRemoteButtonSelection(self, event):
+@@ -2646,7 +2647,7 @@ class Wizard(wx.Dialog):
+             size_page = self.GetSizeTuple()
+             size_wiz = tuple_max(size_wiz, size_page)
+             page.Hide()
+-            self.sizer_top_right.Remove(page)
++            self.sizer_top_right.Detach(page)
+ 
+         if self.min_page_width and (size_wiz[0] < self.min_page_width):
+             size_wiz = (self.min_page_width, size_wiz[1])
+@@ -2654,7 +2655,7 @@ class Wizard(wx.Dialog):
+         if self.min_page_height and (size_wiz[1] < self.min_page_height):
+             size_wiz = (size_wiz[0], self.min_page_height )
+ 
+-        self.SetSize(size_wiz)
++        self.SetClientSize(size_wiz)
+ 
+     def SetInitialPage(self, page):
+         if self.cur_page:
+@@ -2716,7 +2717,7 @@ class Wizard(wx.Dialog):
+             prev_page = self.cur_page
+             if prev_page:
+                 prev_page.Hide()
+-                self.sizer_top_right.Remove(prev_page)
++                self.sizer_top_right.Detach(prev_page)
+ 
+             self.cur_page = page
+ 
+@@ -2807,8 +2808,7 @@ class Finalizer(object):
+ def main(argv):
+     appdir = os.path.dirname(argv[0])
+ 
+-    app = wx.PySimpleApp()
+-    wx.InitAllImageHandlers()
++    app = wx.App(False)
+ 
+     resources = Resources(appdir, True)
+     resources.LoadImages()

Reply via email to