Bug#755757: cecilia: Patch for wxPython 3.0
Control: tags 755757 + patch
Dear maintainer,
With the attached patch, the wx-related errors I originally got are gone,
as is another sizer-related error I got after fixing those.
Let me know if you're like me to NMU these changes.
Cheers,
Olly
diff -Nru cecilia-5.0.9/debian/changelog cecilia-5.0.9/debian/changelog
--- cecilia-5.0.9/debian/changelog 2013-11-29 14:35:03.000000000 +1300
+++ cecilia-5.0.9/debian/changelog 2014-09-20 14:46:01.000000000 +1200
@@ -1,3 +1,11 @@
+cecilia (5.0.9-1.1) unstable; urgency=medium
+
+ * Non-maintainer upload.
+ * Update for wxPython 3.0 (Closes: #755757):
+ + New patch: wxpython3.0.patch
+
+ -- Olly Betts <olly@survex.com> Sat, 20 Sep 2014 02:45:20 +0000
+
cecilia (5.0.9-1) unstable; urgency=low
* New upstream release.
diff -Nru cecilia-5.0.9/debian/patches/series cecilia-5.0.9/debian/patches/series
--- cecilia-5.0.9/debian/patches/series 2013-11-29 14:35:03.000000000 +1300
+++ cecilia-5.0.9/debian/patches/series 2014-09-20 14:20:46.000000000 +1200
@@ -1 +1,2 @@
use-distutils.diff
+wxpython3.0.patch
diff -Nru cecilia-5.0.9/debian/patches/wxpython3.0.patch cecilia-5.0.9/debian/patches/wxpython3.0.patch
--- cecilia-5.0.9/debian/patches/wxpython3.0.patch 1970-01-01 12:00:00.000000000 +1200
+++ cecilia-5.0.9/debian/patches/wxpython3.0.patch 2014-09-20 14:51:03.000000000 +1200
@@ -0,0 +1,124 @@
+Description: Update for wxPython 3.0
+ These changes should remain compatible with wxPython 2.8.
+Author: Olly Betts <olly@survex.com>
+Bug-Debian: https://bugs.debian.org/755757
+Forwarded: no
+Last-Update: 2014-09-20
+
+Index: cecilia-5.0.9/Resources/CeciliaLib.py
+===================================================================
+--- cecilia-5.0.9.orig/Resources/CeciliaLib.py
++++ cecilia-5.0.9/Resources/CeciliaLib.py
+@@ -170,7 +170,7 @@ def saveFileDialog(parent, wildcard, typ
+ defaultFile = os.path.split(getVar("currentCeciliaFile", unicode=True))[1].split(".")[0]
+ saveAsDialog = wx.FileDialog(parent, message="%s file as ..." % type,
+ defaultDir=defaultPath, defaultFile=defaultFile+ext,
+- wildcard=wildcard, style=wx.SAVE | wx.FD_OVERWRITE_PROMPT)
++ wildcard=wildcard, style=wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT)
+ if saveAsDialog.ShowModal() == wx.ID_OK:
+ filePath = ensureNFD(saveAsDialog.GetPath())
+ if type == 'Save audio':
+@@ -224,7 +224,7 @@ def loadPlayerEditor(app_type):
+ path = ''
+ dlg = wx.FileDialog(None, message="Choose a %s..." % app_type,
+ defaultDir=os.path.expanduser('~'),
+- wildcard=wildcard, style=wx.OPEN)
++ wildcard=wildcard, style=wx.FD_OPEN)
+
+ if dlg.ShowModal() == wx.ID_OK:
+ path = dlg.GetPath()
+@@ -540,7 +540,7 @@ def openCeciliaFile(parent, openfile=Non
+ wildcard = "Cecilia file (*.%s)|*.%s" % (FILE_EXTENSION, FILE_EXTENSION)
+ defaultPath = getVar("openFilePath", unicode=True)
+ openDialog = wx.FileDialog(parent, message='Choose a Cecilia file to open...',
+- defaultDir=defaultPath, wildcard=wildcard, style=wx.OPEN)
++ defaultDir=defaultPath, wildcard=wildcard, style=wx.FD_OPEN)
+ if openDialog.ShowModal() == wx.ID_OK:
+ cecFilePath = openDialog.GetPath()
+ setVar("openFilePath", (os.path.split(cecFilePath)[0]))
+Index: cecilia-5.0.9/Resources/CeciliaPlot.py
+===================================================================
+--- cecilia-5.0.9.orig/Resources/CeciliaPlot.py
++++ cecilia-5.0.9/Resources/CeciliaPlot.py
+@@ -702,7 +702,7 @@ class PlotCanvas(wx.Panel):
+ self,
+ "Choose a file with extension bmp, gif, xbm, xpm, png, or jpg", ".", "",
+ "BMP files (*.bmp)|*.bmp|XBM files (*.xbm)|*.xbm|XPM file (*.xpm)|*.xpm|PNG files (*.png)|*.png|JPG files (*.jpg)|*.jpg",
+- wx.SAVE|wx.OVERWRITE_PROMPT
++ wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT
+ )
+ try:
+ while 1:
+Index: cecilia-5.0.9/Resources/DocFrame.py
+===================================================================
+--- cecilia-5.0.9.orig/Resources/DocFrame.py
++++ cecilia-5.0.9/Resources/DocFrame.py
+@@ -534,7 +534,7 @@ class ManualFrame(wx.Frame):
+ self.doc_panel.collapseAll()
+
+ if __name__ == "__main__":
+- app = wx.PySimpleApp()
++ app = wx.App(False)
+ doc_frame = ManualFrame()
+ doc_frame.Show()
+ app.MainLoop()
+Index: cecilia-5.0.9/Resources/Grapher.py
+===================================================================
+--- cecilia-5.0.9.orig/Resources/Grapher.py
++++ cecilia-5.0.9/Resources/Grapher.py
+@@ -1468,7 +1468,7 @@ class CECGrapher(wx.Panel):
+ def OnSave(self):
+ line = self.plotter.getLine(self.plotter.getSelected())
+ dlg = wx.FileDialog(self, message="Save file as ...", defaultDir=os.getcwd(),
+- defaultFile="", style=wx.SAVE)
++ defaultFile="", style=wx.FD_SAVE)
+ if dlg.ShowModal() == wx.ID_OK:
+ path = dlg.GetPath()
+ f = open(path, 'w')
+@@ -1479,7 +1479,7 @@ class CECGrapher(wx.Panel):
+ def OnLoad(self):
+ line = self.plotter.getLine(self.plotter.getSelected())
+ dlg = wx.FileDialog(self, message="Choose a grapher file", defaultDir=CeciliaLib.getVar("grapherLinePath"),
+- defaultFile="", style=wx.OPEN | wx.CHANGE_DIR)
++ defaultFile="", style=wx.FD_OPEN | wx.FD_CHANGE_DIR)
+ if dlg.ShowModal() == wx.ID_OK:
+ path = dlg.GetPath()
+ CeciliaLib.setVar("grapherLinePath", os.path.split(path)[0])
+Index: cecilia-5.0.9/Resources/Control.py
+===================================================================
+--- cecilia-5.0.9.orig/Resources/Control.py
++++ cecilia-5.0.9/Resources/Control.py
+@@ -81,7 +81,7 @@ class CECControl(scrolled.ScrolledPanel)
+ self.bounce_dlg = None
+ self.tmpTotalTime = CeciliaLib.getVar("totalTime")
+
+- self.sizerMain = wx.FlexGridSizer(3,1)
++ self.sizerMain = wx.FlexGridSizer(3,0)
+
+ self.sizerMain.Add(Separator(self, (230,1), colour=TITLE_BACK_COLOUR), 1, wx.EXPAND)
+
+@@ -372,7 +372,7 @@ class CECControl(scrolled.ScrolledPanel)
+ def createOutputPanel(self):
+ self.outputPanel = wx.Panel(self, -1, style=wx.NO_BORDER)
+ self.outputPanel.SetBackgroundColour(BACKGROUND_COLOUR)
+- outputSizer = wx.FlexGridSizer(5,1)
++ outputSizer = wx.FlexGridSizer(5,0)
+
+ outputTextPanel = wx.Panel(self.outputPanel, -1, style=wx.NO_BORDER)
+ outputTextPanel.SetBackgroundColour(TITLE_BACK_COLOUR)
+Index: cecilia-5.0.9/Resources/splash.py
+===================================================================
+--- cecilia-5.0.9.orig/Resources/splash.py
++++ cecilia-5.0.9/Resources/splash.py
+@@ -64,10 +64,7 @@ class CeciliaSplashScreen(wx.Frame):
+ dc.DrawRectangle(0,0,w,h)
+ dc.DrawBitmap(self.bmp, 0,0,True)
+ dc.SetTextForeground("#333333")
+- font = dc.GetFont()
+- if sys.platform != "win32":
+- font.SetFaceName("Monaco")
+- font.SetPixelSize((15,15))
++ font = wx.FFontFromPixelSize(pixelSize=(15,15), family=wx.FONTFAMILY_DEFAULT, face="Monaco")
+ dc.SetFont(font)
+ dc.DrawLabel("Cecilia %s" % APP_VERSION, wx.Rect(280, 185, 200, 15), wx.ALIGN_RIGHT)
+ dc.DrawLabel(u"Spirit of the project: Jean Piché", wx.Rect(280, 200, 200, 15), wx.ALIGN_RIGHT)
Reply to: