Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tlinnet/44887c3056f33314f432cd35fe222ee0 to your computer and use it in GitHub Desktop.
Save tlinnet/44887c3056f33314f432cd35fe222ee0 to your computer and use it in GitHub Desktop.
Patch for mMass 5.5.0 to work with wxPython 3.0, instead of 2.8
From d4414403d7f403347d1886b9538a80a208c5fc70 Mon Sep 17 00:00:00 2001
From: ljz643 <ljz643@BL07540.science.domain>
Date: Thu, 7 Sep 2017 15:56:00 +0200
Subject: [PATCH] Made pathches, to get mMass 5.5.0 to work on wxPython 3.0
The patches was made from here:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=758949
https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=758949;filename=mmass-5.5.0-3.1-nmu.diff;msg=17
---
gui/main_frame.py | 2 +-
gui/panel_about.py | 2 +-
gui/panel_calibration.py | 2 +-
gui/panel_compounds_search.py | 2 +-
gui/panel_document_export.py | 8 ++++----
gui/panel_document_info.py | 2 +-
gui/panel_envelope_fit.py | 4 ++--
gui/panel_mascot.py | 2 +-
gui/panel_mass_calculator.py | 2 +-
gui/panel_mass_filter.py | 2 +-
gui/panel_mass_to_formula.py | 2 +-
gui/panel_match.py | 2 +-
gui/panel_monomer_library.py | 2 +-
gui/panel_periodic_table.py | 2 +-
gui/panel_processing.py | 2 +-
gui/panel_profound.py | 2 +-
gui/panel_prospector.py | 2 +-
gui/panel_sequence.py | 2 +-
gui/panel_spectrum_generator.py | 2 +-
mmass.py | 3 +++
20 files changed, 26 insertions(+), 23 deletions(-)
diff --git a/gui/main_frame.py b/gui/main_frame.py
index c9ba37b..0d2ae14 100644
--- a/gui/main_frame.py
+++ b/gui/main_frame.py
@@ -1526,7 +1526,7 @@ class mainFrame(wx.Frame):
# ask for name
fileName = document.title+'.msd'
- dlg = wx.FileDialog(self, "Save", config.main['lastDir'], fileName, "mMass Spectrum Document|*.msd", wx.SAVE|wx.OVERWRITE_PROMPT)
+ dlg = wx.FileDialog(self, "Save", config.main['lastDir'], fileName, "mMass Spectrum Document|*.msd", wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT)
if dlg.ShowModal() == wx.ID_OK:
path = dlg.GetPath()
config.main['lastDir'] = os.path.split(path)[0]
diff --git a/gui/panel_about.py b/gui/panel_about.py
index 55952e1..95f966e 100644
--- a/gui/panel_about.py
+++ b/gui/panel_about.py
@@ -40,7 +40,7 @@ class panelAbout(frame):
"""About mMass."""
def __init__(self, parent):
- frame.__init__(self, parent, -1, frameTitle, style=wx.DEFAULT_FRAME_STYLE & ~ (wx.RESIZE_BORDER | wx.RESIZE_BOX | wx.MAXIMIZE_BOX | wx.MINIMIZE_BOX))
+ frame.__init__(self, parent, -1, frameTitle, style=wx.DEFAULT_FRAME_STYLE & ~ (wx.RESIZE_BORDER | wx.MAXIMIZE_BOX | wx.MINIMIZE_BOX))
self.parent = parent
# make gui items
diff --git a/gui/panel_calibration.py b/gui/panel_calibration.py
index d4c5ca3..ce1c950 100644
--- a/gui/panel_calibration.py
+++ b/gui/panel_calibration.py
@@ -38,7 +38,7 @@ class panelCalibration(wx.MiniFrame):
"""Calibration tool."""
def __init__(self, parent, tool='references'):
- wx.MiniFrame.__init__(self, parent, -1, 'Calibration', size=(400, 300), style=wx.DEFAULT_FRAME_STYLE & ~ (wx.RESIZE_BOX | wx.MAXIMIZE_BOX))
+ wx.MiniFrame.__init__(self, parent, -1, 'Calibration', size=(400, 300), style=wx.DEFAULT_FRAME_STYLE & ~ wx.MAXIMIZE_BOX)
self.parent = parent
self.processing = None
diff --git a/gui/panel_compounds_search.py b/gui/panel_compounds_search.py
index bf9984d..59b6ce1 100644
--- a/gui/panel_compounds_search.py
+++ b/gui/panel_compounds_search.py
@@ -39,7 +39,7 @@ class panelCompoundsSearch(wx.MiniFrame):
"""Compounds search tool."""
def __init__(self, parent, tool='compounds'):
- wx.MiniFrame.__init__(self, parent, -1, 'Compounds Search', size=(400, 300), style=wx.DEFAULT_FRAME_STYLE & ~ (wx.RESIZE_BOX | wx.MAXIMIZE_BOX))
+ wx.MiniFrame.__init__(self, parent, -1, 'Compounds Search', size=(400, 300), style=wx.DEFAULT_FRAME_STYLE & ~ wx.MAXIMIZE_BOX)
self.parent = parent
self.matchPanel = None
diff --git a/gui/panel_document_export.py b/gui/panel_document_export.py
index 66ae8aa..69c7ada 100644
--- a/gui/panel_document_export.py
+++ b/gui/panel_document_export.py
@@ -35,7 +35,7 @@ class panelDocumentExport(wx.MiniFrame):
"""Document export tools."""
def __init__(self, parent, tool='image'):
- wx.MiniFrame.__init__(self, parent, -1, 'Export', size=(400, 300), style=wx.DEFAULT_FRAME_STYLE & ~ (wx.RESIZE_BORDER | wx.RESIZE_BOX | wx.MAXIMIZE_BOX))
+ wx.MiniFrame.__init__(self, parent, -1, 'Export', size=(400, 300), style=wx.DEFAULT_FRAME_STYLE & ~ (wx.RESIZE_BORDER | wx.MAXIMIZE_BOX))
self.parent = parent
self.processing = None
@@ -508,7 +508,7 @@ class panelDocumentExport(wx.MiniFrame):
fileType = "JPEG image file|*.jpg"
# raise export dialog
- dlg = wx.FileDialog(self, "Export Spectrum Image", config.main['lastDir'], fileName, fileType, wx.SAVE|wx.OVERWRITE_PROMPT)
+ dlg = wx.FileDialog(self, "Export Spectrum Image", config.main['lastDir'], fileName, fileType, wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT)
if dlg.ShowModal() == wx.ID_OK:
path = dlg.GetPath()
config.main['lastDir'] = os.path.split(path)[0]
@@ -544,7 +544,7 @@ class panelDocumentExport(wx.MiniFrame):
fileType = "MGF file|*.mgf"
# raise export dialog
- dlg = wx.FileDialog(self, "Export Peak List", config.main['lastDir'], fileName, fileType, wx.SAVE|wx.OVERWRITE_PROMPT)
+ dlg = wx.FileDialog(self, "Export Peak List", config.main['lastDir'], fileName, fileType, wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT)
if dlg.ShowModal() == wx.ID_OK:
path = dlg.GetPath()
config.main['lastDir'] = os.path.split(path)[0]
@@ -579,7 +579,7 @@ class panelDocumentExport(wx.MiniFrame):
fileType = "ASCII file|*.txt"
# raise export dialog
- dlg = wx.FileDialog(self, "Export Spectrum Data", config.main['lastDir'], fileName, fileType, wx.SAVE|wx.OVERWRITE_PROMPT)
+ dlg = wx.FileDialog(self, "Export Spectrum Data", config.main['lastDir'], fileName, fileType, wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT)
if dlg.ShowModal() == wx.ID_OK:
path = dlg.GetPath()
config.main['lastDir'] = os.path.split(path)[0]
diff --git a/gui/panel_document_info.py b/gui/panel_document_info.py
index 73113de..9cc2c89 100644
--- a/gui/panel_document_info.py
+++ b/gui/panel_document_info.py
@@ -34,7 +34,7 @@ class panelDocumentInfo(wx.MiniFrame):
"""Document info tools."""
def __init__(self, parent, tool='summary'):
- wx.MiniFrame.__init__(self, parent, -1, 'Document Information', size=(400, 200), style=wx.DEFAULT_FRAME_STYLE & ~ (wx.RESIZE_BORDER | wx.RESIZE_BOX | wx.MAXIMIZE_BOX))
+ wx.MiniFrame.__init__(self, parent, -1, 'Document Information', size=(400, 200), style=wx.DEFAULT_FRAME_STYLE & ~ (wx.RESIZE_BORDER | wx.MAXIMIZE_BOX))
self.parent = parent
diff --git a/gui/panel_envelope_fit.py b/gui/panel_envelope_fit.py
index 1832237..2b87c11 100644
--- a/gui/panel_envelope_fit.py
+++ b/gui/panel_envelope_fit.py
@@ -35,7 +35,7 @@ class panelEnvelopeFit(wx.MiniFrame):
"""Envelope fit tool."""
def __init__(self, parent):
- wx.MiniFrame.__init__(self, parent, -1, 'Envelope Fit', size=(400, 300), style=wx.DEFAULT_FRAME_STYLE & ~ (wx.RESIZE_BOX | wx.MAXIMIZE_BOX))
+ wx.MiniFrame.__init__(self, parent, -1, 'Envelope Fit', size=(400, 300), style=wx.DEFAULT_FRAME_STYLE & ~ wx.MAXIMIZE_BOX)
self.parent = parent
@@ -722,4 +722,4 @@ class panelEnvelopeFit(wx.MiniFrame):
# ----
-
\ No newline at end of file
+
diff --git a/gui/panel_mascot.py b/gui/panel_mascot.py
index d93c448..6ca03a3 100644
--- a/gui/panel_mascot.py
+++ b/gui/panel_mascot.py
@@ -42,7 +42,7 @@ class panelMascot(wx.MiniFrame):
"""Mascot search tool."""
def __init__(self, parent, tool=config.mascot['common']['searchType']):
- wx.MiniFrame.__init__(self, parent, -1, 'Mascot Tools', size=(300, -1), style=wx.DEFAULT_FRAME_STYLE & ~ (wx.RESIZE_BORDER | wx.RESIZE_BOX | wx.MAXIMIZE_BOX))
+ wx.MiniFrame.__init__(self, parent, -1, 'Mascot Tools', size=(300, -1), style=wx.DEFAULT_FRAME_STYLE & ~ (wx.RESIZE_BORDER | wx.MAXIMIZE_BOX))
self.parent = parent
self.processing = None
diff --git a/gui/panel_mass_calculator.py b/gui/panel_mass_calculator.py
index 57179f7..2d30e75 100644
--- a/gui/panel_mass_calculator.py
+++ b/gui/panel_mass_calculator.py
@@ -37,7 +37,7 @@ class panelMassCalculator(wx.MiniFrame):
"""Mass calculator tools."""
def __init__(self, parent, tool='pattern'):
- wx.MiniFrame.__init__(self, parent, -1, 'Mass Calculator', size=(400, 300), style=wx.DEFAULT_FRAME_STYLE & ~ (wx.RESIZE_BOX | wx.MAXIMIZE_BOX))
+ wx.MiniFrame.__init__(self, parent, -1, 'Mass Calculator', size=(400, 300), style=wx.DEFAULT_FRAME_STYLE & ~ wx.MAXIMIZE_BOX)
self.parent = parent
diff --git a/gui/panel_mass_filter.py b/gui/panel_mass_filter.py
index d789d31..1954fbf 100644
--- a/gui/panel_mass_filter.py
+++ b/gui/panel_mass_filter.py
@@ -36,7 +36,7 @@ class panelMassFilter(wx.MiniFrame):
"""Mass filter tool."""
def __init__(self, parent):
- wx.MiniFrame.__init__(self, parent, -1, 'Mass Filter', size=(400, 300), style=wx.DEFAULT_FRAME_STYLE & ~ (wx.RESIZE_BOX | wx.MAXIMIZE_BOX))
+ wx.MiniFrame.__init__(self, parent, -1, 'Mass Filter', size=(400, 300), style=wx.DEFAULT_FRAME_STYLE & ~ wx.MAXIMIZE_BOX)
self.parent = parent
self.matchPanel = None
diff --git a/gui/panel_mass_to_formula.py b/gui/panel_mass_to_formula.py
index a01f63b..0fc1e93 100644
--- a/gui/panel_mass_to_formula.py
+++ b/gui/panel_mass_to_formula.py
@@ -38,7 +38,7 @@ class panelMassToFormula(wx.MiniFrame):
"""Mass to formula tool."""
def __init__(self, parent):
- wx.MiniFrame.__init__(self, parent, -1, 'Mass To Formula', size=(400, 300), style=wx.DEFAULT_FRAME_STYLE & ~ (wx.RESIZE_BOX | wx.MAXIMIZE_BOX))
+ wx.MiniFrame.__init__(self, parent, -1, 'Mass To Formula', size=(400, 300), style=wx.DEFAULT_FRAME_STYLE & ~ wx.MAXIMIZE_BOX)
self.parent = parent
diff --git a/gui/panel_match.py b/gui/panel_match.py
index 5feeb1e..029c4d2 100644
--- a/gui/panel_match.py
+++ b/gui/panel_match.py
@@ -36,7 +36,7 @@ class panelMatch(wx.MiniFrame):
"""Data match tool."""
def __init__(self, parentTool, mainFrame, module):
- wx.MiniFrame.__init__(self, parentTool, -1, 'Match Data', size=(400, 300), style=wx.DEFAULT_FRAME_STYLE & ~ (wx.RESIZE_BOX | wx.MAXIMIZE_BOX))
+ wx.MiniFrame.__init__(self, parentTool, -1, 'Match Data', size=(400, 300), style=wx.DEFAULT_FRAME_STYLE & ~ wx.MAXIMIZE_BOX)
self.parentTool = parentTool
self.mainFrame = mainFrame
diff --git a/gui/panel_monomer_library.py b/gui/panel_monomer_library.py
index 184426c..454f305 100644
--- a/gui/panel_monomer_library.py
+++ b/gui/panel_monomer_library.py
@@ -34,7 +34,7 @@ class panelMonomerLibrary(wx.MiniFrame):
"""Monomer library."""
def __init__(self, parent, filterIn=[], filterOut=[], DnD=True):
- wx.MiniFrame.__init__(self, parent, -1, 'Monomer Library', size=(250, 300), style=wx.DEFAULT_FRAME_STYLE & ~ (wx.RESIZE_BOX | wx.MAXIMIZE_BOX))
+ wx.MiniFrame.__init__(self, parent, -1, 'Monomer Library', size=(250, 300), style=wx.DEFAULT_FRAME_STYLE & ~ wx.MAXIMIZE_BOX)
self.parent = parent
self.filterIn = filterIn
diff --git a/gui/panel_periodic_table.py b/gui/panel_periodic_table.py
index 7223cb5..046972a 100644
--- a/gui/panel_periodic_table.py
+++ b/gui/panel_periodic_table.py
@@ -34,7 +34,7 @@ class panelPeriodicTable(wx.MiniFrame):
"""Periodic table of elements."""
def __init__(self, parent):
- wx.MiniFrame.__init__(self, parent, -1, 'Periodic Table of the Elements', size=(400, 300), style=wx.DEFAULT_FRAME_STYLE & ~ (wx.RESIZE_BOX | wx.RESIZE_BORDER | wx.MAXIMIZE_BOX))
+ wx.MiniFrame.__init__(self, parent, -1, 'Periodic Table of the Elements', size=(400, 300), style=wx.DEFAULT_FRAME_STYLE & ~ (wx.RESIZE_BORDER | wx.MAXIMIZE_BOX))
self.parent = parent
diff --git a/gui/panel_processing.py b/gui/panel_processing.py
index 5676623..22843b0 100644
--- a/gui/panel_processing.py
+++ b/gui/panel_processing.py
@@ -38,7 +38,7 @@ class panelProcessing(wx.MiniFrame):
"""Data processing tools."""
def __init__(self, parent, tool='peakpicking'):
- wx.MiniFrame.__init__(self, parent, -1, 'Processing', size=(300, -1), style=wx.DEFAULT_FRAME_STYLE & ~ (wx.RESIZE_BORDER | wx.RESIZE_BOX | wx.MAXIMIZE_BOX))
+ wx.MiniFrame.__init__(self, parent, -1, 'Processing', size=(300, -1), style=wx.DEFAULT_FRAME_STYLE & ~ (wx.RESIZE_BORDER | wx.MAXIMIZE_BOX))
self.parent = parent
diff --git a/gui/panel_profound.py b/gui/panel_profound.py
index 80a3ce7..7516cf3 100644
--- a/gui/panel_profound.py
+++ b/gui/panel_profound.py
@@ -37,7 +37,7 @@ class panelProfound(wx.MiniFrame):
"""Profound search tool."""
def __init__(self, parent, tool='pmf'):
- wx.MiniFrame.__init__(self, parent, -1, 'ProFound Search', size=(300, -1), style=wx.DEFAULT_FRAME_STYLE & ~ (wx.RESIZE_BORDER | wx.RESIZE_BOX | wx.MAXIMIZE_BOX))
+ wx.MiniFrame.__init__(self, parent, -1, 'ProFound Search', size=(300, -1), style=wx.DEFAULT_FRAME_STYLE & ~ (wx.RESIZE_BORDER | wx.MAXIMIZE_BOX))
self.parent = parent
diff --git a/gui/panel_prospector.py b/gui/panel_prospector.py
index 2e641cf..247b821 100644
--- a/gui/panel_prospector.py
+++ b/gui/panel_prospector.py
@@ -37,7 +37,7 @@ class panelProspector(wx.MiniFrame):
"""ProteinProspector search tools."""
def __init__(self, parent, tool=config.prospector['common']['searchType']):
- wx.MiniFrame.__init__(self, parent, -1, 'Protein Prospector', size=(300, -1), style=wx.DEFAULT_FRAME_STYLE & ~ (wx.RESIZE_BORDER | wx.RESIZE_BOX | wx.MAXIMIZE_BOX))
+ wx.MiniFrame.__init__(self, parent, -1, 'Protein Prospector', size=(300, -1), style=wx.DEFAULT_FRAME_STYLE & ~ (wx.RESIZE_BORDER | wx.MAXIMIZE_BOX))
self.parent = parent
diff --git a/gui/panel_sequence.py b/gui/panel_sequence.py
index 35880ca..1898802 100644
--- a/gui/panel_sequence.py
+++ b/gui/panel_sequence.py
@@ -39,7 +39,7 @@ class panelSequence(wx.MiniFrame):
"""Sequence tools."""
def __init__(self, parent, tool='editor'):
- wx.MiniFrame.__init__(self, parent, -1, 'Sequence', size=(500, 300), style=wx.DEFAULT_FRAME_STYLE & ~ (wx.RESIZE_BOX | wx.MAXIMIZE_BOX))
+ wx.MiniFrame.__init__(self, parent, -1, 'Sequence', size=(500, 300), style=wx.DEFAULT_FRAME_STYLE & ~ wx.MAXIMIZE_BOX)
self.parent = parent
self.matchPanel = None
diff --git a/gui/panel_spectrum_generator.py b/gui/panel_spectrum_generator.py
index d595240..4b19a02 100644
--- a/gui/panel_spectrum_generator.py
+++ b/gui/panel_spectrum_generator.py
@@ -35,7 +35,7 @@ class panelSpectrumGenerator(wx.MiniFrame):
"""Spectrum generator tool."""
def __init__(self, parent):
- wx.MiniFrame.__init__(self, parent, -1, 'Spectrum Generator', size=(700, 400), style=wx.DEFAULT_FRAME_STYLE & ~ (wx.RESIZE_BOX | wx.MAXIMIZE_BOX))
+ wx.MiniFrame.__init__(self, parent, -1, 'Spectrum Generator', size=(700, 400), style=wx.DEFAULT_FRAME_STYLE & ~ wx.MAXIMIZE_BOX)
self.parent = parent
diff --git a/mmass.py b/mmass.py
index c6812e4..d287e4f 100644
--- a/mmass.py
+++ b/mmass.py
@@ -37,6 +37,9 @@ class mMass(wx.App):
def OnInit(self):
"""Init application."""
+
+ # Suppress WXDEBUG assertions, as happens by default with wx2.8.
+ self.SetAssertMode(wx.PYAPP_ASSERT_SUPPRESS)
# set some special wx params
mwx.appInit()
--
1.8.3.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment