[GRASS-SVN] r64611 - in grass/branches/releasebranch_7_0/gui/wxpython: animation core gcp gmodeler gui_core location_wizard mapdisp mapswipe modules psmap wxplot

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Feb 13 08:16:34 PST 2015


Author: martinl
Date: 2015-02-13 08:16:34 -0800 (Fri, 13 Feb 2015)
New Revision: 64611

Modified:
   grass/branches/releasebranch_7_0/gui/wxpython/animation/dialogs.py
   grass/branches/releasebranch_7_0/gui/wxpython/core/globalvar.py
   grass/branches/releasebranch_7_0/gui/wxpython/gcp/mapdisplay.py
   grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/frame.py
   grass/branches/releasebranch_7_0/gui/wxpython/gui_core/forms.py
   grass/branches/releasebranch_7_0/gui/wxpython/gui_core/goutput.py
   grass/branches/releasebranch_7_0/gui/wxpython/location_wizard/wizard.py
   grass/branches/releasebranch_7_0/gui/wxpython/mapdisp/frame.py
   grass/branches/releasebranch_7_0/gui/wxpython/mapswipe/frame.py
   grass/branches/releasebranch_7_0/gui/wxpython/modules/colorrules.py
   grass/branches/releasebranch_7_0/gui/wxpython/modules/histogram.py
   grass/branches/releasebranch_7_0/gui/wxpython/modules/mcalc_builder.py
   grass/branches/releasebranch_7_0/gui/wxpython/psmap/dialogs.py
   grass/branches/releasebranch_7_0/gui/wxpython/psmap/frame.py
   grass/branches/releasebranch_7_0/gui/wxpython/wxplot/profile.py
Log:
Fix to work with wxPython 3.0
Author: Olly Betts <olly at survex.com>
(taken from http://anonscm.debian.org/cgit/pkg-grass/grass.git/)
(merge r64610 from trunk)


Modified: grass/branches/releasebranch_7_0/gui/wxpython/animation/dialogs.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/animation/dialogs.py	2015-02-13 16:13:41 UTC (rev 64610)
+++ grass/branches/releasebranch_7_0/gui/wxpython/animation/dialogs.py	2015-02-13 16:16:34 UTC (rev 64611)
@@ -854,7 +854,7 @@
                                                   labelText=_("Image file:"),
                                                   dialogTitle=_('Choose image file'),
                                                   buttonText=_('Browse'),
-                                                  startDirectory=os.getcwd(), fileMode=wx.OPEN,
+                                                  startDirectory=os.getcwd(), fileMode=wx.FD_OPEN,
                                                   changeCallback=self.OnSetImage)
         self.imageBox.Add(self.browse, proportion=1, flag=wx.EXPAND)
         self.hidevbox.Add(self.imageBox, proportion=0, flag=wx.EXPAND | wx.BOTTOM, border=5)
@@ -948,7 +948,7 @@
                                                      labelText=_("GIF file:"),
                                                      dialogTitle=_("Choose file to save animation"),
                                                      buttonText=_("Browse"),
-                                                     startDirectory=os.getcwd(), fileMode=wx.SAVE)
+                                                     startDirectory=os.getcwd(), fileMode=wx.FD_SAVE)
         gifGridSizer = wx.GridBagSizer(hgap=5, vgap=5)
         gifGridSizer.AddGrowableCol(0)
         gifGridSizer.Add(self.gifBrowse, pos=(0, 0), flag = wx.EXPAND)
@@ -965,7 +965,7 @@
                                                      labelText=_("SWF file:"),
                                                      dialogTitle=_("Choose file to save animation"),
                                                      buttonText=_("Browse"),
-                                                     startDirectory=os.getcwd(), fileMode=wx.SAVE)
+                                                     startDirectory=os.getcwd(), fileMode=wx.FD_SAVE)
         swfGridSizer = wx.GridBagSizer(hgap=5, vgap=5)
         swfGridSizer.AddGrowableCol(0)
         swfGridSizer.Add(self.swfBrowse, pos=(0, 0), flag = wx.EXPAND)
@@ -988,7 +988,7 @@
                                                      labelText=_("AVI file:"),
                                                      dialogTitle=_("Choose file to save animation"),
                                                      buttonText=_("Browse"),
-                                                     startDirectory=os.getcwd(), fileMode=wx.SAVE)
+                                                     startDirectory=os.getcwd(), fileMode=wx.FD_SAVE)
         encodingLabel = wx.StaticText(parent=aviPanel, id=wx.ID_ANY, label=_("Video codec:"))
         self.encodingText = wx.TextCtrl(parent=aviPanel, id=wx.ID_ANY, value='mpeg4')
         optionsLabel = wx.StaticText(parent=aviPanel, label=_("Additional options:"))

Modified: grass/branches/releasebranch_7_0/gui/wxpython/core/globalvar.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/core/globalvar.py	2015-02-13 16:13:41 UTC (rev 64610)
+++ grass/branches/releasebranch_7_0/gui/wxpython/core/globalvar.py	2015-02-13 16:16:34 UTC (rev 64611)
@@ -43,7 +43,7 @@
 
 def CheckWxVersion(version):
     """Check wx version"""
-    ver = wx.version().split(' ')[0]
+    ver = wx.__version__
     if map(int, ver.split('.')) < version:
         return False
 
@@ -63,7 +63,7 @@
         # wxversion.select(str(minVersion[0]) + '.' + str(minVersion[1]))
         wxversion.ensureMinimal(str(minVersion[0]) + '.' + str(minVersion[1]))
         import wx
-        version = wx.version().split(' ')[0]
+        version = wx.__version__
 
         if map(int, version.split('.')) < minVersion:
             raise ValueError('Your wxPython version is %s.%s.%s.%s' % tuple(version.split('.')))

Modified: grass/branches/releasebranch_7_0/gui/wxpython/gcp/mapdisplay.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/gcp/mapdisplay.py	2015-02-13 16:13:41 UTC (rev 64610)
+++ grass/branches/releasebranch_7_0/gui/wxpython/gcp/mapdisplay.py	2015-02-13 16:16:34 UTC (rev 64611)
@@ -383,7 +383,7 @@
                             message = _("Choose a file name to save the image "
                                         "(no need to add extension)"),
                             wildcard = filetype,
-                            style=wx.SAVE | wx.FD_OVERWRITE_PROMPT)
+                            style=wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT)
         
         if dlg.ShowModal() == wx.ID_OK:
             path = dlg.GetPath()

Modified: grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/frame.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/frame.py	2015-02-13 16:13:41 UTC (rev 64610)
+++ grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/frame.py	2015-02-13 16:16:34 UTC (rev 64611)
@@ -578,7 +578,7 @@
                             defaultDir = "",
                             defaultFile = "",
                             wildcard = filetype,
-                            style=wx.SAVE | wx.FD_OVERWRITE_PROMPT)
+                            style=wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT)
         
         if dlg.ShowModal() == wx.ID_OK:
             path = dlg.GetPath()

Modified: grass/branches/releasebranch_7_0/gui/wxpython/gui_core/forms.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/gui_core/forms.py	2015-02-13 16:13:41 UTC (rev 64610)
+++ grass/branches/releasebranch_7_0/gui/wxpython/gui_core/forms.py	2015-02-13 16:16:34 UTC (rev 64611)
@@ -1504,9 +1504,9 @@
                 # file selector
                 elif p.get('prompt','') !=  'color' and p.get('prompt', '') == 'file':
                     if p.get('age', 'new') == 'new':
-                        fmode = wx.SAVE
+                        fmode = wx.FD_SAVE
                     else:
-                        fmode = wx.OPEN
+                        fmode = wx.FD_OPEN
                     # check wildcard
                     try:
                         fExt = os.path.splitext(p.get('key_desc', ['*.*'])[0])[1]
@@ -1915,7 +1915,7 @@
         dlg = wx.FileDialog(parent = self,
                             message = _("Save input as..."),
                             defaultDir = os.getcwd(),
-                            style = wx.SAVE | wx.FD_OVERWRITE_PROMPT)
+                            style = wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT)
 
         if dlg.ShowModal() == wx.ID_OK:
             path = dlg.GetPath()

Modified: grass/branches/releasebranch_7_0/gui/wxpython/gui_core/goutput.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/gui_core/goutput.py	2015-02-13 16:13:41 UTC (rev 64610)
+++ grass/branches/releasebranch_7_0/gui/wxpython/gui_core/goutput.py	2015-02-13 16:16:34 UTC (rev 64611)
@@ -375,7 +375,7 @@
                             defaultFile = "grass_cmd_output.txt",
                             wildcard = _("%(txt)s (*.txt)|*.txt|%(files)s (*)|*") % 
                             {'txt': _("Text files"), 'files': _("Files")},
-                            style = wx.SAVE | wx.FD_OVERWRITE_PROMPT)
+                            style = wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT)
         
         # Show the dialog and retrieve the user response. If it is the OK response,
         # process the data.
@@ -462,7 +462,7 @@
                                 defaultFile = "grass_cmd_log.txt",
                                 wildcard = _("%(txt)s (*.txt)|*.txt|%(files)s (*)|*") % 
                                             {'txt': _("Text files"), 'files': _("Files")},
-                                style = wx.SAVE)
+                                style = wx.FD_SAVE)
             if dlg.ShowModal() == wx.ID_OK:
                 self.cmdFileProtocol = dlg.GetPath()
             else:

Modified: grass/branches/releasebranch_7_0/gui/wxpython/location_wizard/wizard.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/location_wizard/wizard.py	2015-02-13 16:13:41 UTC (rev 64610)
+++ grass/branches/releasebranch_7_0/gui/wxpython/location_wizard/wizard.py	2015-02-13 16:16:34 UTC (rev 64611)
@@ -73,6 +73,8 @@
         # main sizers
         self.pagesizer = wx.BoxSizer(wx.VERTICAL)
         self.sizer = wx.GridBagSizer(vgap = 0, hgap = 0)
+        self.sizer.SetCols(5)
+        self.sizer.SetRows(6)
         
     def DoLayout(self):
         """Do page layout"""
@@ -1219,7 +1221,7 @@
         """Choose file"""
         dlg = wx.FileDialog(self,
                             _("Select georeferenced file"),
-                            os.getcwd(), "", "*.*", wx.OPEN)
+                            os.getcwd(), "", "*.*", wx.FD_OPEN)
         if dlg.ShowModal() == wx.ID_OK:
             path = dlg.GetPath()
             self.tfile.SetValue(path)
@@ -1292,7 +1294,7 @@
                             message = _("Select Well Known Text (WKT) .prj file"),
                             defaultDir = os.getcwd(),
                             wildcard = "PRJ files (*.prj)|*.prj|Files (*.*)|*.*",
-                            style = wx.OPEN)
+                            style = wx.FD_OPEN)
 
         if dlg.ShowModal() == wx.ID_OK:
             path = dlg.GetPath()
@@ -1469,7 +1471,7 @@
             path = os.getcwd()
         
         dlg = wx.FileDialog(parent = self, message = _("Choose EPSG codes file"),
-                            defaultDir = path, defaultFile = "", wildcard = "*", style = wx.OPEN)
+                            defaultDir = path, defaultFile = "", wildcard = "*", style = wx.FD_OPEN)
         
         if dlg.ShowModal() == wx.ID_OK:
             path = dlg.GetPath()

Modified: grass/branches/releasebranch_7_0/gui/wxpython/mapdisp/frame.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/mapdisp/frame.py	2015-02-13 16:13:41 UTC (rev 64610)
+++ grass/branches/releasebranch_7_0/gui/wxpython/mapdisp/frame.py	2015-02-13 16:16:34 UTC (rev 64611)
@@ -587,7 +587,7 @@
                             message = _("Choose a file name to save the image "
                                         "(no need to add extension)"),
                             wildcard = filetype,
-                            style = wx.SAVE | wx.FD_OVERWRITE_PROMPT)
+                            style = wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT)
         
         if dlg.ShowModal() == wx.ID_OK:
             path = dlg.GetPath()

Modified: grass/branches/releasebranch_7_0/gui/wxpython/mapswipe/frame.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/mapswipe/frame.py	2015-02-13 16:13:41 UTC (rev 64610)
+++ grass/branches/releasebranch_7_0/gui/wxpython/mapswipe/frame.py	2015-02-13 16:16:34 UTC (rev 64611)
@@ -524,7 +524,7 @@
                             message = _("Choose a file name to save the image "
                                         "(no need to add extension)"),
                             wildcard = filetype,
-                            style = wx.SAVE | wx.FD_OVERWRITE_PROMPT)
+                            style = wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT)
         
         if dlg.ShowModal() == wx.ID_OK:
             path = dlg.GetPath()

Modified: grass/branches/releasebranch_7_0/gui/wxpython/modules/colorrules.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/modules/colorrules.py	2015-02-13 16:13:41 UTC (rev 64610)
+++ grass/branches/releasebranch_7_0/gui/wxpython/modules/colorrules.py	2015-02-13 16:16:34 UTC (rev 64611)
@@ -408,7 +408,7 @@
                                                      buttonText = _('Load'),
                                                      toolTip = _("Type filename or click to choose "
                                                                  "file and load color table"),
-                                                     startDirectory = os.getcwd(), fileMode = wx.OPEN,
+                                                     startDirectory = os.getcwd(), fileMode = wx.FD_OPEN,
                                                      changeCallback = self.OnLoadRulesFile)
         self.saveRules = filebrowse.FileBrowseButton(parent = parent, id = wx.ID_ANY, fileMask = '*',
                                                      labelText = '',
@@ -416,7 +416,7 @@
                                                      toolTip = _("Type filename or click to choose "
                                                                  "file and save color table"),
                                                      buttonText = _('Save'),
-                                                     startDirectory = os.getcwd(), fileMode = wx.SAVE,
+                                                     startDirectory = os.getcwd(), fileMode = wx.FD_SAVE,
                                                      changeCallback = self.OnSaveRulesFile)
 
         colorTable = ColorTablesComboBox(parent = parent, size=globalvar.DIALOG_COMBOBOX_SIZE,

Modified: grass/branches/releasebranch_7_0/gui/wxpython/modules/histogram.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/modules/histogram.py	2015-02-13 16:13:41 UTC (rev 64610)
+++ grass/branches/releasebranch_7_0/gui/wxpython/modules/histogram.py	2015-02-13 16:16:34 UTC (rev 64611)
@@ -423,7 +423,7 @@
                             message = _("Choose a file name to save the image "
                                         "(no need to add extension)"),
                             wildcard = filetype,
-                            style=wx.SAVE | wx.FD_OVERWRITE_PROMPT)
+                            style=wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT)
         
         if dlg.ShowModal() == wx.ID_OK:
             path = dlg.GetPath()

Modified: grass/branches/releasebranch_7_0/gui/wxpython/modules/mcalc_builder.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/modules/mcalc_builder.py	2015-02-13 16:13:41 UTC (rev 64610)
+++ grass/branches/releasebranch_7_0/gui/wxpython/modules/mcalc_builder.py	2015-02-13 16:16:34 UTC (rev 64611)
@@ -615,7 +615,7 @@
         dlg = wx.FileDialog(parent = self,
                             message = _("Choose a file name to save the expression"),
                             wildcard = _("Expression file (*)|*"),
-                            style = wx.SAVE | wx.FD_OVERWRITE_PROMPT)
+                            style = wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT)
         if dlg.ShowModal() == wx.ID_OK:
             path = dlg.GetPath()
             if not path:
@@ -636,7 +636,7 @@
         dlg = wx.FileDialog(parent = self,
                             message = _("Choose a file name to load the expression"),
                             wildcard = _("Expression file (*)|*"),
-                            style = wx.OPEN)
+                            style = wx.FD_OPEN)
         if dlg.ShowModal() == wx.ID_OK:
             path = dlg.GetPath()
             if not path:

Modified: grass/branches/releasebranch_7_0/gui/wxpython/psmap/dialogs.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/psmap/dialogs.py	2015-02-13 16:13:41 UTC (rev 64610)
+++ grass/branches/releasebranch_7_0/gui/wxpython/psmap/dialogs.py	2015-02-13 16:16:34 UTC (rev 64611)
@@ -1970,7 +1970,7 @@
         self.epsFileCtrl = filebrowse.FileBrowseButton(panel, id = wx.ID_ANY, labelText = '',
                                 buttonText =  _("Browse"), toolTip = _("Type filename or click browse to choose file"), 
                                 dialogTitle = _("Choose a file"), startDirectory = '', initialValue = '',
-                                fileMask = "Encapsulated PostScript (*.eps)|*.eps|All files (*.*)|*.*", fileMode = wx.OPEN)
+                                fileMask = "Encapsulated PostScript (*.eps)|*.eps|All files (*.*)|*.*", fileMode = wx.FD_OPEN)
         if not self.vPropertiesDict['eps']:
             self.epsFileCtrl.SetValue('')
         else: #eps chosen
@@ -2159,7 +2159,7 @@
         self.patFileCtrl = filebrowse.FileBrowseButton(panel, id = wx.ID_ANY, labelText = _("Choose pattern file:"),
                                 buttonText =  _("Browse"), toolTip = _("Type filename or click browse to choose file"), 
                                 dialogTitle = _("Choose a file"), startDirectory = self.patternPath, initialValue = '',
-                                fileMask = "Encapsulated PostScript (*.eps)|*.eps|All files (*.*)|*.*", fileMode = wx.OPEN)
+                                fileMask = "Encapsulated PostScript (*.eps)|*.eps|All files (*.*)|*.*", fileMode = wx.FD_OPEN)
         self.patWidthText = wx.StaticText(panel, id = wx.ID_ANY, label = _("pattern line width (pts):"))
         self.patWidthSpin = wx.SpinCtrl(panel, id = wx.ID_ANY, min = 1, max = 25, initial = 1)
         self.patScaleText = wx.StaticText(panel, id = wx.ID_ANY, label = _("pattern scale factor:"))

Modified: grass/branches/releasebranch_7_0/gui/wxpython/psmap/frame.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/psmap/frame.py	2015-02-13 16:13:41 UTC (rev 64610)
+++ grass/branches/releasebranch_7_0/gui/wxpython/psmap/frame.py	2015-02-13 16:16:34 UTC (rev 64611)
@@ -398,7 +398,7 @@
         filename = ''
         dlg = wx.FileDialog(self, message = _("Save file as"), defaultDir = "", 
                             defaultFile = mapName, wildcard = wildcard,
-                            style = wx.CHANGE_DIR | wx.SAVE | wx.OVERWRITE_PROMPT)
+                            style = wx.FD_CHANGE_DIR | wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT)
         if dlg.ShowModal() == wx.ID_OK:
             filename = dlg.GetPath()
             suffix = suffix[dlg.GetFilterIndex()]
@@ -423,7 +423,7 @@
         filename = ''
         dlg = wx.FileDialog(self, message = "Find instructions file", defaultDir = "", 
                             defaultFile = '', wildcard = "All files (*.*)|*.*",
-                            style = wx.CHANGE_DIR|wx.OPEN)
+                            style = wx.FD_CHANGE_DIR|wx.FD_OPEN)
         if dlg.ShowModal() == wx.ID_OK:
             filename = dlg.GetPath()
         dlg.Destroy()

Modified: grass/branches/releasebranch_7_0/gui/wxpython/wxplot/profile.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/wxplot/profile.py	2015-02-13 16:13:41 UTC (rev 64610)
+++ grass/branches/releasebranch_7_0/gui/wxpython/wxplot/profile.py	2015-02-13 16:16:34 UTC (rev 64611)
@@ -341,7 +341,7 @@
         dlg = wx.FileDialog(parent = self,
                             message = _("Choose prefix for file(s) where to save profile values..."),
                             defaultDir = os.getcwd(), 
-                            wildcard = _("Comma separated value (*.csv)|*.csv"), style = wx.SAVE)
+                            wildcard = _("Comma separated value (*.csv)|*.csv"), style = wx.FD_SAVE)
         pfile = []
         if dlg.ShowModal() == wx.ID_OK:
             path = dlg.GetPath()



More information about the grass-commit mailing list