[GRASS-SVN] r64997 - in grass/branches/releasebranch_6_4/gui/wxpython: core dbmgr gcp gmodeler gui_core location_wizard mapdisp modules nviz psmap wxplot

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Apr 6 11:45:47 PDT 2015


Author: neteler
Date: 2015-04-06 11:45:47 -0700 (Mon, 06 Apr 2015)
New Revision: 64997

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/core/globalvar.py
   grass/branches/releasebranch_6_4/gui/wxpython/dbmgr/manager.py
   grass/branches/releasebranch_6_4/gui/wxpython/gcp/mapdisplay.py
   grass/branches/releasebranch_6_4/gui/wxpython/gmodeler/frame.py
   grass/branches/releasebranch_6_4/gui/wxpython/gui_core/forms.py
   grass/branches/releasebranch_6_4/gui/wxpython/gui_core/ghelp.py
   grass/branches/releasebranch_6_4/gui/wxpython/gui_core/goutput.py
   grass/branches/releasebranch_6_4/gui/wxpython/location_wizard/wizard.py
   grass/branches/releasebranch_6_4/gui/wxpython/mapdisp/frame.py
   grass/branches/releasebranch_6_4/gui/wxpython/modules/colorrules.py
   grass/branches/releasebranch_6_4/gui/wxpython/modules/histogram.py
   grass/branches/releasebranch_6_4/gui/wxpython/modules/mcalc_builder.py
   grass/branches/releasebranch_6_4/gui/wxpython/nviz/tools.py
   grass/branches/releasebranch_6_4/gui/wxpython/psmap/dialogs.py
   grass/branches/releasebranch_6_4/gui/wxpython/psmap/frame.py
   grass/branches/releasebranch_6_4/gui/wxpython/wxplot/profile.py
Log:
wxGUI: wxpy3.0-compat_patch_Debian.diff applied (author: Olly Betts), source http://ftp.de.debian.org/debian/pool/main/g/grass/grass_6.4.4-1.debian.tar.xz

Modified: grass/branches/releasebranch_6_4/gui/wxpython/core/globalvar.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/core/globalvar.py	2015-04-06 17:16:46 UTC (rev 64996)
+++ grass/branches/releasebranch_6_4/gui/wxpython/core/globalvar.py	2015-04-06 18:45:47 UTC (rev 64997)
@@ -32,7 +32,7 @@
 
 def CheckWxVersion(version = [2, 8, 11, 0]):
     """!Check wx version"""
-    ver = wx.version().split(' ')[0]
+    ver = wx.__version__
     if map(int, ver.split('.')) < version:
         return False
     
@@ -53,7 +53,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_6_4/gui/wxpython/dbmgr/manager.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/dbmgr/manager.py	2015-04-06 17:16:46 UTC (rev 64996)
+++ grass/branches/releasebranch_6_4/gui/wxpython/dbmgr/manager.py	2015-04-06 18:45:47 UTC (rev 64997)
@@ -3101,9 +3101,10 @@
     if len(argv) != 2:
         print >> sys.stderr, __doc__
         sys.exit()
-    
+
     #some applications might require image handlers
-    wx.InitAllImageHandlers()
+    if not globalvar.CheckWxVersion([2, 9]):
+        wx.InitAllImageHandlers()
     
     app = wx.PySimpleApp()
     f = AttributeManager(parent = None, id = wx.ID_ANY,

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gcp/mapdisplay.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gcp/mapdisplay.py	2015-04-06 17:16:46 UTC (rev 64996)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gcp/mapdisplay.py	2015-04-06 18:45:47 UTC (rev 64997)
@@ -456,7 +456,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_6_4/gui/wxpython/gmodeler/frame.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gmodeler/frame.py	2015-04-06 17:16:46 UTC (rev 64996)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gmodeler/frame.py	2015-04-06 18:45:47 UTC (rev 64997)
@@ -551,7 +551,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()
@@ -1657,7 +1657,8 @@
     gettext.install('grasswxpy', os.path.join(os.getenv("GISBASE"), 'locale'), unicode = True)
     
     app = wx.PySimpleApp()
-    wx.InitAllImageHandlers()
+    if not globalvar.CheckWxVersion([2, 9]):
+        wx.InitAllImageHandlers()
     frame = ModelFrame(parent = None)
     if len(sys.argv) > 1:
         frame.LoadModelFile(sys.argv[1])

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_core/forms.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_core/forms.py	2015-04-06 17:16:46 UTC (rev 64996)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_core/forms.py	2015-04-06 18:45:47 UTC (rev 64997)
@@ -1296,9 +1296,9 @@
                 # file selector
                 elif p.get('prompt','') !=  'color' and p.get('element', '') ==  'file':
                     if p.get('age', 'new_file') == 'new_file':
-                        fmode = wx.SAVE
+                        fmode = wx.FD_SAVE
                     else:
-                        fmode = wx.OPEN
+                        fmode = wx.FD_OPEN
                     fbb = filebrowse.FileBrowseButton(parent = which_panel, id = wx.ID_ANY, fileMask = '*',
                                                       size = globalvar.DIALOG_GSELECT_SIZE, labelText = '',
                                                       dialogTitle = _('Choose %s') % \
@@ -1549,7 +1549,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_6_4/gui/wxpython/gui_core/ghelp.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_core/ghelp.py	2015-04-06 17:16:46 UTC (rev 64996)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_core/ghelp.py	2015-04-06 18:45:47 UTC (rev 64997)
@@ -88,6 +88,7 @@
         """!Do layout"""
         sizer = wx.StaticBoxSizer(self.box, wx.HORIZONTAL)
         gridSizer = wx.GridBagSizer(hgap = 3, vgap = 3)
+        gridSizer.SetCols(2)
         
         gridSizer.Add(item = self.searchBy,
                       flag = wx.ALIGN_CENTER_VERTICAL, pos = (0, 0))
@@ -397,6 +398,7 @@
         infoTxt.SetupScrolling()
         infoSizer = wx.BoxSizer(wx.VERTICAL)
         infoGridSizer = wx.GridBagSizer(vgap = 5, hgap = 5)
+        infoGridSizer.SetCols(2)
         logo = os.path.join(globalvar.ETCDIR, "gui", "icons", "grass-64x64.png")
         logoBitmap = wx.StaticBitmap(parent = infoTxt, id = wx.ID_ANY,
                                      bitmap = wx.Bitmap(name = logo,

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_core/goutput.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_core/goutput.py	2015-04-06 17:16:46 UTC (rev 64996)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_core/goutput.py	2015-04-06 18:45:47 UTC (rev 64997)
@@ -662,7 +662,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.
@@ -812,7 +812,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_6_4/gui/wxpython/location_wizard/wizard.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/location_wizard/wizard.py	2015-04-06 17:16:46 UTC (rev 64996)
+++ grass/branches/releasebranch_6_4/gui/wxpython/location_wizard/wizard.py	2015-04-06 18:45:47 UTC (rev 64997)
@@ -72,6 +72,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"""
@@ -1168,7 +1170,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)
@@ -1241,7 +1243,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()
@@ -1419,7 +1421,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_6_4/gui/wxpython/mapdisp/frame.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/mapdisp/frame.py	2015-04-06 17:16:46 UTC (rev 64996)
+++ grass/branches/releasebranch_6_4/gui/wxpython/mapdisp/frame.py	2015-04-06 18:45:47 UTC (rev 64997)
@@ -576,7 +576,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_6_4/gui/wxpython/modules/colorrules.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/modules/colorrules.py	2015-04-06 17:16:46 UTC (rev 64996)
+++ grass/branches/releasebranch_6_4/gui/wxpython/modules/colorrules.py	2015-04-06 18:45:47 UTC (rev 64997)
@@ -395,7 +395,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 = '*',
                                                      size = globalvar.DIALOG_GSELECT_SIZE,
@@ -404,7 +404,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)
         
         default = wx.Button(parent = parent, id = wx.ID_ANY, label = _("Reload default table"))   

Modified: grass/branches/releasebranch_6_4/gui/wxpython/modules/histogram.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/modules/histogram.py	2015-04-06 17:16:46 UTC (rev 64996)
+++ grass/branches/releasebranch_6_4/gui/wxpython/modules/histogram.py	2015-04-06 18:45:47 UTC (rev 64997)
@@ -416,7 +416,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_6_4/gui/wxpython/modules/mcalc_builder.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/modules/mcalc_builder.py	2015-04-06 17:16:46 UTC (rev 64996)
+++ grass/branches/releasebranch_6_4/gui/wxpython/modules/mcalc_builder.py	2015-04-06 18:45:47 UTC (rev 64997)
@@ -515,7 +515,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:
@@ -536,7 +536,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_6_4/gui/wxpython/nviz/tools.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/nviz/tools.py	2015-04-06 17:16:46 UTC (rev 64996)
+++ grass/branches/releasebranch_6_4/gui/wxpython/nviz/tools.py	2015-04-06 18:45:47 UTC (rev 64997)
@@ -519,7 +519,7 @@
         self.mainPanelData.SetupScrolling(scroll_x = False)
 ##        style = fpb.CaptionBarStyle()
 ##        style.SetCaptionStyle(fpb.CAPTIONBAR_FILLED_RECTANGLE)
-##        style.SetFirstColour(wx.Color(250,250,250))
+##        style.SetFirstColour(wx.Colour(250,250,250))
         try:# wxpython <= 2.8.10
             self.foldpanelData = fpb.FoldPanelBar(parent = self.mainPanelData, id = wx.ID_ANY,
                                                   style = fpb.FPB_DEFAULT_STYLE,

Modified: grass/branches/releasebranch_6_4/gui/wxpython/psmap/dialogs.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/psmap/dialogs.py	2015-04-06 17:16:46 UTC (rev 64996)
+++ grass/branches/releasebranch_6_4/gui/wxpython/psmap/dialogs.py	2015-04-06 18:45:47 UTC (rev 64997)
@@ -1969,7 +1969,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
@@ -2158,7 +2158,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_6_4/gui/wxpython/psmap/frame.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/psmap/frame.py	2015-04-06 17:16:46 UTC (rev 64996)
+++ grass/branches/releasebranch_6_4/gui/wxpython/psmap/frame.py	2015-04-06 18:45:47 UTC (rev 64997)
@@ -392,7 +392,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()]
@@ -417,7 +417,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()
@@ -2220,7 +2220,8 @@
     gettext.install('grasswxpy', os.path.join(os.getenv("GISBASE"), 'locale'), unicode = True)
     
     app = wx.PySimpleApp()
-    wx.InitAllImageHandlers()
+    if not globalvar.CheckWxVersion([2, 9]):
+        wx.InitAllImageHandlers()
     frame = PsMapFrame()
     frame.Show()
     

Modified: grass/branches/releasebranch_6_4/gui/wxpython/wxplot/profile.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/wxplot/profile.py	2015-04-06 17:16:46 UTC (rev 64996)
+++ grass/branches/releasebranch_6_4/gui/wxpython/wxplot/profile.py	2015-04-06 18:45:47 UTC (rev 64997)
@@ -332,7 +332,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