[GRASS-SVN] r64610 - in grass/trunk/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:13:41 PST 2015


Author: martinl
Date: 2015-02-13 08:13:41 -0800 (Fri, 13 Feb 2015)
New Revision: 64610

Modified:
   grass/trunk/gui/wxpython/animation/dialogs.py
   grass/trunk/gui/wxpython/core/globalvar.py
   grass/trunk/gui/wxpython/gcp/mapdisplay.py
   grass/trunk/gui/wxpython/gmodeler/frame.py
   grass/trunk/gui/wxpython/gui_core/forms.py
   grass/trunk/gui/wxpython/gui_core/goutput.py
   grass/trunk/gui/wxpython/location_wizard/wizard.py
   grass/trunk/gui/wxpython/mapdisp/frame.py
   grass/trunk/gui/wxpython/mapswipe/frame.py
   grass/trunk/gui/wxpython/modules/colorrules.py
   grass/trunk/gui/wxpython/modules/histogram.py
   grass/trunk/gui/wxpython/modules/mcalc_builder.py
   grass/trunk/gui/wxpython/psmap/dialogs.py
   grass/trunk/gui/wxpython/psmap/frame.py
   grass/trunk/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/)


Modified: grass/trunk/gui/wxpython/animation/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/animation/dialogs.py	2015-02-13 15:27:09 UTC (rev 64609)
+++ grass/trunk/gui/wxpython/animation/dialogs.py	2015-02-13 16:13:41 UTC (rev 64610)
@@ -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/trunk/gui/wxpython/core/globalvar.py
===================================================================
--- grass/trunk/gui/wxpython/core/globalvar.py	2015-02-13 15:27:09 UTC (rev 64609)
+++ grass/trunk/gui/wxpython/core/globalvar.py	2015-02-13 16:13:41 UTC (rev 64610)
@@ -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
 
@@ -67,7 +67,7 @@
             wxversion.select(forceVersion)
         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/trunk/gui/wxpython/gcp/mapdisplay.py
===================================================================
--- grass/trunk/gui/wxpython/gcp/mapdisplay.py	2015-02-13 15:27:09 UTC (rev 64609)
+++ grass/trunk/gui/wxpython/gcp/mapdisplay.py	2015-02-13 16:13:41 UTC (rev 64610)
@@ -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/trunk/gui/wxpython/gmodeler/frame.py
===================================================================
--- grass/trunk/gui/wxpython/gmodeler/frame.py	2015-02-13 15:27:09 UTC (rev 64609)
+++ grass/trunk/gui/wxpython/gmodeler/frame.py	2015-02-13 16:13:41 UTC (rev 64610)
@@ -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/trunk/gui/wxpython/gui_core/forms.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/forms.py	2015-02-13 15:27:09 UTC (rev 64609)
+++ grass/trunk/gui/wxpython/gui_core/forms.py	2015-02-13 16:13:41 UTC (rev 64610)
@@ -1503,9 +1503,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]
@@ -1924,7 +1924,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/trunk/gui/wxpython/gui_core/goutput.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/goutput.py	2015-02-13 15:27:09 UTC (rev 64609)
+++ grass/trunk/gui/wxpython/gui_core/goutput.py	2015-02-13 16:13:41 UTC (rev 64610)
@@ -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/trunk/gui/wxpython/location_wizard/wizard.py
===================================================================
--- grass/trunk/gui/wxpython/location_wizard/wizard.py	2015-02-13 15:27:09 UTC (rev 64609)
+++ grass/trunk/gui/wxpython/location_wizard/wizard.py	2015-02-13 16:13:41 UTC (rev 64610)
@@ -74,6 +74,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"""
@@ -1220,7 +1222,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)
@@ -1293,7 +1295,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()
@@ -1470,7 +1472,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/trunk/gui/wxpython/mapdisp/frame.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/frame.py	2015-02-13 15:27:09 UTC (rev 64609)
+++ grass/trunk/gui/wxpython/mapdisp/frame.py	2015-02-13 16:13:41 UTC (rev 64610)
@@ -617,7 +617,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/trunk/gui/wxpython/mapswipe/frame.py
===================================================================
--- grass/trunk/gui/wxpython/mapswipe/frame.py	2015-02-13 15:27:09 UTC (rev 64609)
+++ grass/trunk/gui/wxpython/mapswipe/frame.py	2015-02-13 16:13:41 UTC (rev 64610)
@@ -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/trunk/gui/wxpython/modules/colorrules.py
===================================================================
--- grass/trunk/gui/wxpython/modules/colorrules.py	2015-02-13 15:27:09 UTC (rev 64609)
+++ grass/trunk/gui/wxpython/modules/colorrules.py	2015-02-13 16:13:41 UTC (rev 64610)
@@ -409,7 +409,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 = '',
@@ -417,7 +417,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/trunk/gui/wxpython/modules/histogram.py
===================================================================
--- grass/trunk/gui/wxpython/modules/histogram.py	2015-02-13 15:27:09 UTC (rev 64609)
+++ grass/trunk/gui/wxpython/modules/histogram.py	2015-02-13 16:13:41 UTC (rev 64610)
@@ -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/trunk/gui/wxpython/modules/mcalc_builder.py
===================================================================
--- grass/trunk/gui/wxpython/modules/mcalc_builder.py	2015-02-13 15:27:09 UTC (rev 64609)
+++ grass/trunk/gui/wxpython/modules/mcalc_builder.py	2015-02-13 16:13:41 UTC (rev 64610)
@@ -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/trunk/gui/wxpython/psmap/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/psmap/dialogs.py	2015-02-13 15:27:09 UTC (rev 64609)
+++ grass/trunk/gui/wxpython/psmap/dialogs.py	2015-02-13 16:13:41 UTC (rev 64610)
@@ -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/trunk/gui/wxpython/psmap/frame.py
===================================================================
--- grass/trunk/gui/wxpython/psmap/frame.py	2015-02-13 15:27:09 UTC (rev 64609)
+++ grass/trunk/gui/wxpython/psmap/frame.py	2015-02-13 16:13:41 UTC (rev 64610)
@@ -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/trunk/gui/wxpython/wxplot/profile.py
===================================================================
--- grass/trunk/gui/wxpython/wxplot/profile.py	2015-02-13 15:27:09 UTC (rev 64609)
+++ grass/trunk/gui/wxpython/wxplot/profile.py	2015-02-13 16:13:41 UTC (rev 64610)
@@ -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