[GRASS-SVN] r32425 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jul 31 16:12:39 EDT 2008


Author: martinl
Date: 2008-07-31 16:12:38 -0400 (Thu, 31 Jul 2008)
New Revision: 32425

Modified:
   grass/trunk/gui/wxpython/gui_modules/dbm.py
   grass/trunk/gui/wxpython/gui_modules/georect.py
   grass/trunk/gui/wxpython/gui_modules/nviz.py
   grass/trunk/gui/wxpython/gui_modules/preferences.py
   grass/trunk/gui/wxpython/gui_modules/vdigit.py
   grass/trunk/gui/wxpython/gui_modules/workspace.py
Log:
wxGUI: suppress gettext warnings

Modified: grass/trunk/gui/wxpython/gui_modules/dbm.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/dbm.py	2008-07-31 20:02:02 UTC (rev 32424)
+++ grass/trunk/gui/wxpython/gui_modules/dbm.py	2008-07-31 20:12:38 UTC (rev 32425)
@@ -229,10 +229,11 @@
                         cat = -1
                         wx.MessageBox(parent=self,
                                       message=_("Error loading attribute data. "
-                                                "Record number: %d. Unable to cast value '%s' in "
-                                                "key column (%s) to integer.\n\n"
-                                                "Details: %s") % \
-                                          (i + 1, value, keyColumn, e),
+                                                "Record number: %(rec)d. Unable to cast value '%(val)s' in "
+                                                "key column (%(key)s) to integer.\n\n"
+                                                "Details: %(detail)s") % \
+                                          { 'rec' : i + 1, 'val' : value,
+                                            'key' : keyColumn, 'detail' : e},
                                       caption=_("Error"),
                                       style=wx.OK | wx.ICON_ERROR | wx.CENTRE)
                 j += 1

Modified: grass/trunk/gui/wxpython/gui_modules/georect.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/georect.py	2008-07-31 20:02:02 UTC (rev 32424)
+++ grass/trunk/gui/wxpython/gui_modules/georect.py	2008-07-31 20:12:38 UTC (rev 32425)
@@ -1120,8 +1120,8 @@
         self.bkw_rmserror = round((sumsq_bkw_err/i)**0.5,4)
         self.list.ResizeColumns()
 
-        self.SetStatusText(_('RMS error for selected points forward: %s backward: %s') % \
-                           (self.fwd_rmserror, self.bkw_rmserror))
+        self.SetStatusText(_('RMS error for selected points forward: %(fwd)s backward: %(bkw)s') % \
+                           { 'fwd' : self.fwd_rmserror, 'bkw' : self.bkw_rmserror })
         
 class GCPList(wx.ListCtrl,
               CheckListCtrlMixin,

Modified: grass/trunk/gui/wxpython/gui_modules/nviz.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/nviz.py	2008-07-31 20:02:02 UTC (rev 32424)
+++ grass/trunk/gui/wxpython/gui_modules/nviz.py	2008-07-31 20:12:38 UTC (rev 32425)
@@ -629,8 +629,8 @@
                 id = self.nvizClass.LoadVector(str(layer.name), True)
 
             if id < 0:
-                print >> sys.stderr, "Nviz:" + _("Loading vector map <%s> (%s) failed") % \
-                    (layer.name, type)
+                print >> sys.stderr, "Nviz:" + _("Loading vector map <%(name)s> (%()types) failed") % \
+                    { 'name' : layer.name, 'type' : type }
                 continue
 
             # update layer properties
@@ -679,11 +679,11 @@
             else:
                 ret = self.nvizClass.UnloadVector(id, True)
             if ret == 0:
-                print >> sys.stderr, "Nviz:" + _("Unable to unload vector map <%s> (%s)") % \
-                    (layer.name, vtype)
+                print >> sys.stderr, "Nviz:" + _("Unable to unload vector map <%(name)s> (%(type)s)") % \
+                    { 'name': layer.name, 'type' : vtype }
             else:
-                print "Nviz:" + _("Vector map <%s> (%s) unloaded successfully") % \
-                    (layer.name, vtype)
+                print "Nviz:" + _("Vector map <%(name)s> (%(type)s) unloaded successfully") % \
+                    { 'name' : layer.name, 'type' : vtype }
 
             
             data[vtype].pop('object')

Modified: grass/trunk/gui/wxpython/gui_modules/preferences.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/preferences.py	2008-07-31 20:02:02 UTC (rev 32424)
+++ grass/trunk/gui/wxpython/gui_modules/preferences.py	2008-07-31 20:12:38 UTC (rev 32425)
@@ -543,9 +543,11 @@
                     self.Append(settings, group, key, subkey, value)
                     idx += 2
         except ValueError, e:
-            print >> sys.stderr, _("Error: Reading settings from file <%s> failed.\n"
-                                   "       Details: %s\n"
-                                   "       Line: '%s'") % (filename, e, line)
+            print >> sys.stderr, _("Error: Reading settings from file <%(file)s> failed.\n"
+                                   "       Details: %(detail)s\n"
+                                   "       Line: '%(line)s'") % { 'file' : filename,
+                                                                  'detail' : e,
+                                                                  'line' : line }
             file.close()
 
         file.close()
@@ -602,8 +604,9 @@
         except IOError, e:
             raise gcmd.SettingsError(message=e)
         except StandardError, e:
-            raise gcmd.SettingsError(message=_('Writing settings to file <%s> failed.'
-                                               '\n\nDetails: %s') % (filePath, e))
+            raise gcmd.SettingsError(message=_('Writing settings to file <%(file)s> failed.'
+                                               '\n\nDetails: %(detail)s') % { 'file' : filePath,
+                                                                              'detail' : e })
         
         file.close()
 

Modified: grass/trunk/gui/wxpython/gui_modules/vdigit.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/vdigit.py	2008-07-31 20:02:02 UTC (rev 32424)
+++ grass/trunk/gui/wxpython/gui_modules/vdigit.py	2008-07-31 20:12:38 UTC (rev 32425)
@@ -140,9 +140,9 @@
             ret = self.driver.Reset(self.map)
         except StandardError, e:
             raise gcmd.DigitError(parent=self.mapWindow.parent,
-                                  message=_('Unable to initialize display driver, '
-                                            'see README file for more information.%s%s'
-                                            'Details: %s (%s)') % (os.linesep, os.linesep, e, digitErr))
+                                  message="%s %s (%s)" % (_('Unable to initialize display driver, '
+                                                            'see README file for more information.\n\n'
+                                                            'Details:'), e, digitErr))
         
         if map and ret == -1:
             raise gcmd.DigitError(parent=self.mapWindow.parent,

Modified: grass/trunk/gui/wxpython/gui_modules/workspace.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/workspace.py	2008-07-31 20:02:02 UTC (rev 32424)
+++ grass/trunk/gui/wxpython/gui_modules/workspace.py	2008-07-31 20:12:38 UTC (rev 32425)
@@ -622,9 +622,9 @@
         if self.num_error > 0:
             wx.MessageBox(parent=parent,
                           message=_("Some lines were skipped when reading settings "
-                                    "from file <%s>.\nSee 'Command output' window for details.\n\n"
-                                    "Number of skipped lines: %d" % \
-                                        (self.filename, self.num_error)),
+                                    "from file <%(file)s>.\nSee 'Command output' window for details.\n\n"
+                                    "Number of skipped lines: %(line)d") % \
+                                        { 'file' : self.filename, 'line' : self.num_error },
                           caption=_("Warning"), style=wx.OK | wx.ICON_EXCLAMATION)
             parent.goutput.WriteLog('Map layers loaded from GRC file <%s>' % self.filename)
             parent.goutput.WriteLog('Skipped lines:\n%s' % self.error)



More information about the grass-commit mailing list