[GRASS-SVN] r47437 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Aug 4 10:22:56 EDT 2011


Author: martinl
Date: 2011-08-04 07:22:56 -0700 (Thu, 04 Aug 2011)
New Revision: 47437

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/psmap.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/psmap_dialogs.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/render.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/utils.py
Log:
wxGUI: fix gettext warnings


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/psmap.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/psmap.py	2011-08-04 14:19:39 UTC (rev 47436)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/psmap.py	2011-08-04 14:22:56 UTC (rev 47437)
@@ -1093,7 +1093,7 @@
                     self.SetCursor(self.cursors["sizenwse"])
                     self.parent.SetStatusText(_('Click and drag to resize object'), 0)
                 else:
-                    self.parent.SetStatusText(_(''), 0)
+                    self.parent.SetStatusText('', 0)
                     self.SetCursor(self.cursors["default"])
                     
         elif event.LeftDown():

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/psmap_dialogs.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/psmap_dialogs.py	2011-08-04 14:19:39 UTC (rev 47436)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/psmap_dialogs.py	2011-08-04 14:22:56 UTC (rev 47437)
@@ -738,7 +738,8 @@
 
                 scale = 1/float(scaleText)
                 if abs(scale - self.instruction['scale']) > (0.01 * scale):
-                    GWarning(_("Scale has changed, old value: %s\nnew value: %s") % (scale, self.instruction['scale']))
+                    GWarning(_("Scale has changed, old value: %(old)s\nnew value: %(new)s") % \
+                                 { 'old' : scale, 'new' : self.instruction['scale'] })
             except (ValueError, IndexError):
                 GError(_("Failed to read instruction %s.\nUse 1:25000 notation.") % instruction)
                 return False
@@ -748,15 +749,17 @@
             if len(maploc) >= 2:
                 if  abs(self.instruction['rect'].Get()[0] - float(maploc[0])) > 0.5 or \
                         abs(self.instruction['rect'].Get()[1] - float(maploc[1])) > 0.5:
-                    GWarning(_("Map frame position changed, old value: %s %s\nnew value: %s %s") % \
-                                 (maploc[0], maploc[1], self.instruction['rect'].Get()[0], self.instruction['rect'].Get()[1]))
+                    GWarning(_("Map frame position changed, old value: %(old1)s %(old2)s\nnew value: %(new1)s %(new2)s") % \
+                                 { 'old1' : maploc[0], 'old2' : maploc[1],
+                                   'new1' : self.instruction['rect'].Get()[0], 'new2' : self.instruction['rect'].Get()[1] })
                     
                 #instr['rect'] = wx.Rect2D(float(maploc[0]), float(maploc[1]), self.instruction['rect'][2], self.instruction['rect'][3])
             if len(maploc) == 4:
                 if  abs(self.instruction['rect'].Get()[2] - float(maploc[2])) > 0.5 or \
                         abs(self.instruction['rect'].Get()[3] - float(maploc[3])) > 0.5:
-                    GWarning(_("Map frame size changed, old value: %s %s\nnew value: %s %s") %(
-                            maploc[2], maploc[3], self.instruction['rect'].Get()[2], self.instruction['rect'].Get()[3]))
+                    GWarning(_("Map frame size changed, old value: %(old1)s %(old2)s\nnew value: %(new1)s %(new2)s") % \
+                                 { 'old1' : maploc[2], 'old2' : maploc[3],
+                                   'new1' : self.instruction['rect'].Get()[2], 'new2' : self.instruction['rect'].Get()[3] })
                 #instr['rect'] = wx.Rect2D(*map(float, maploc))
         self.instruction.update(instr)   
         return True 
@@ -801,7 +804,8 @@
                                 instr[key] = float(value)
                             break
                         except KeyError:
-                            GError(_("Failed to read instruction %s.\nUnknown format %s") % (instruction, format))
+                            GError(_("Failed to read instruction %(file)s.\nUnknown format %(for)s") % \
+                                       { 'file' : instruction, 'for' : format })
                             return False
                         
                     else:
@@ -2208,8 +2212,8 @@
                 stype = 'region'
                 self.select.SetElementList(type = stype)
                 self.mapText.SetLabel(self.mapOrRegionText[1])
-                self.select.SetToolTipString(_(""))
-                
+                self.select.SetToolTipString("")
+
             for each in self.mapSizer.GetChildren():
                 each.GetWindow().Enable()
             for each in self.centerSizer.GetChildren():
@@ -3815,7 +3819,8 @@
         rasterType = getRasterType(map = self.currRaster)
 
         self.rasterCurrent = wx.StaticText(panel, id = wx.ID_ANY,
-                                label = _("%s: type %s" % (self.currRaster, rasterType)))
+                                label = _("%(rast)s: type %(type)s") % { 'rast' : self.currRaster,
+                                                                         'type' : rasterType })
         self.rasterSelect = Select(panel, id = wx.ID_ANY, size = globalvar.DIALOG_GSELECT_SIZE,
                                     type = 'raster', multiple = False,
                                     updateOnPopup = True, onPopup = None)
@@ -4523,9 +4528,10 @@
             currRaster = raster['raster'] 
         else:
             currRaster = None
-
+            
         rasterType = getRasterType(map = currRaster)
-        self.rasterCurrent.SetLabel(_("%s: type %s") % (currRaster, str(rasterType)))
+        self.rasterCurrent.SetLabel(_("%(rast)s: type %(type)s") % \
+                                        { 'rast' : currRaster, 'type' : str(rasterType) })
         
         # vector legend
         

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/render.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/render.py	2011-08-04 14:19:39 UTC (rev 47436)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/render.py	2011-08-04 14:22:56 UTC (rev 47437)
@@ -185,7 +185,8 @@
                                            **self.cmd[1])
             
             if ret != 0:
-                raise gcmd.GException(value = _("'%s' failed. Details: %s") % (self.cmd[0], msg))
+                raise gcmd.GException(value = _("'%(cmd)s' failed. Details: %(det)s") % \
+                                          { 'cmd' : self.cmd[0], 'det' : msg })
         
         except gcmd.GException, e:
             print >> sys.stderr, e.value

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/utils.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/utils.py	2011-08-04 14:19:39 UTC (rev 47436)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/utils.py	2011-08-04 14:22:56 UTC (rev 47437)
@@ -300,7 +300,7 @@
                                     map = fullname,
                                     fs = ';')
     if ret != 0:
-        sys.stderr.write(_("Vector map <%s>: %s\n") % (fullname, msg))
+        sys.stderr.write(_("Vector map <%(map)s>: %(msg)s\n") % { 'map' : fullname, 'msg' : msg })
         return layers
     
     Debug.msg(1, "GetVectorNumberOfLayers(): ret %s" % ret)



More information about the grass-commit mailing list