[GRASS-SVN] r71057 - in grass/branches/releasebranch_7_2/gui/wxpython: core gui_core mapdisp

svn_grass at osgeo.org svn_grass at osgeo.org
Sun May 7 13:46:02 PDT 2017


Author: annakrat
Date: 2017-05-07 13:46:02 -0700 (Sun, 07 May 2017)
New Revision: 71057

Modified:
   grass/branches/releasebranch_7_2/gui/wxpython/core/render.py
   grass/branches/releasebranch_7_2/gui/wxpython/core/workspace.py
   grass/branches/releasebranch_7_2/gui/wxpython/gui_core/forms.py
   grass/branches/releasebranch_7_2/gui/wxpython/mapdisp/frame.py
Log:
wxGUI: fix encoding when loading workspace (merge from trunk, r70531, r70979, r70985)

Modified: grass/branches/releasebranch_7_2/gui/wxpython/core/render.py
===================================================================
--- grass/branches/releasebranch_7_2/gui/wxpython/core/render.py	2017-05-07 20:28:36 UTC (rev 71056)
+++ grass/branches/releasebranch_7_2/gui/wxpython/core/render.py	2017-05-07 20:46:02 UTC (rev 71057)
@@ -1273,8 +1273,8 @@
         renderMgr = layer.GetRenderMgr()
         Debug.msg(
             1, "Map.AddLayer(): ltype={0}, command={1}".format(
-                ltype, layer.GetCmd(
-                    string=True)))
+                ltype, EncodeString(layer.GetCmd(
+                    string=True))))
         if renderMgr:
             if layer.type == 'wms':
                 renderMgr.dataFetched.connect(self.renderMgr.ReportProgress)

Modified: grass/branches/releasebranch_7_2/gui/wxpython/core/workspace.py
===================================================================
--- grass/branches/releasebranch_7_2/gui/wxpython/core/workspace.py	2017-05-07 20:28:36 UTC (rev 71056)
+++ grass/branches/releasebranch_7_2/gui/wxpython/core/workspace.py	2017-05-07 20:46:02 UTC (rev 71057)
@@ -984,7 +984,7 @@
                         self.indent += 4
                         self.file.write(
                             '%s<value>%s</value>\n' %
-                            (' ' * self.indent, self.__filterValue(val)))
+                            (' ' * self.indent, EncodeString(self.__filterValue(val))))
                         self.indent -= 4
                         self.file.write(
                             '%s</parameter>\n' %
@@ -1567,7 +1567,7 @@
             else:
                 self.file.write('%s<parameter name="%s">\n' % (' ' * self.indent, prm.split("=", 1)[0]))
                 self.indent += 4
-                self.file.write('%s<value>%s</value>\n' % (' ' * self.indent, prm.split("=", 1)[1]))
+                self.file.write('%s<value>%s</value>\n' % (' ' * self.indent, EncodeString(prm.split("=", 1)[1])))
                 self.indent -= 4
                 self.file.write('%s</parameter>\n' % (' ' * self.indent))
         self.indent -= 4

Modified: grass/branches/releasebranch_7_2/gui/wxpython/gui_core/forms.py
===================================================================
--- grass/branches/releasebranch_7_2/gui/wxpython/gui_core/forms.py	2017-05-07 20:28:36 UTC (rev 71056)
+++ grass/branches/releasebranch_7_2/gui/wxpython/gui_core/forms.py	2017-05-07 20:46:02 UTC (rev 71057)
@@ -1292,7 +1292,7 @@
                     value = self._getValue(p)
                     if value:
                         # parameter previously set
-                        win.SetValue(str(value))
+                        win.SetValue(value if p.get('type', 'string') == 'string' else str(value))
 
                     win.Bind(wx.EVT_TEXT, self.OnSetValue)
                     style = wx.EXPAND | wx.BOTTOM | wx.LEFT | wx.RIGHT

Modified: grass/branches/releasebranch_7_2/gui/wxpython/mapdisp/frame.py
===================================================================
--- grass/branches/releasebranch_7_2/gui/wxpython/mapdisp/frame.py	2017-05-07 20:28:36 UTC (rev 71056)
+++ grass/branches/releasebranch_7_2/gui/wxpython/mapdisp/frame.py	2017-05-07 20:46:02 UTC (rev 71057)
@@ -245,7 +245,7 @@
         #
         self.Map.GetRenderMgr().updateProgress.connect(self.statusbarManager.SetProgress)
         self.Map.GetRenderMgr().renderingFailed.connect(lambda cmd, error: self._giface.WriteError(
-            _("Failed to run command '{command}'. Details:\n{error}").format(command=' '.join(cmd), error=error)))
+            _("Failed to run command '%(command)s'. Details:\n%(error)s") % dict(command=' '.join(cmd), error=error)))
 
     def GetMapWindow(self):
         return self.MapWindow



More information about the grass-commit mailing list