[GRASS-SVN] r56815 - in grass/branches/releasebranch_6_4/gui/wxpython: . core wxplot

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jun 20 02:10:57 PDT 2013


Author: lucadelu
Date: 2013-06-20 02:10:57 -0700 (Thu, 20 Jun 2013)
New Revision: 56815

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/core/utils.py
   grass/branches/releasebranch_6_4/gui/wxpython/gis_set.py
   grass/branches/releasebranch_6_4/gui/wxpython/wxplot/profile.py
Log:
fix string format for more arguments

Modified: grass/branches/releasebranch_6_4/gui/wxpython/core/utils.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/core/utils.py	2013-06-20 09:01:35 UTC (rev 56814)
+++ grass/branches/releasebranch_6_4/gui/wxpython/core/utils.py	2013-06-20 09:10:57 UTC (rev 56815)
@@ -850,8 +850,10 @@
             try:
                 k, v = map(lambda x: x.strip(), line.split(' ', 1)[1].split('=', 1))
             except StandardError, e:
-                sys.stderr.write(_("%s: line skipped - unable to parse '%s'\n"
-                                   "Reason: %s\n") % (envFile, line, e))
+                
+                sys.stderr.write(_("%(env)s: line skipped - unable to parse "
+                                   "Reason: %(e)s\n") % {'env': envFile, 
+                                                         'line': line, 'e': e})
                 lineSkipped.append(line)
                 continue
             if k in environ:

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gis_set.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gis_set.py	2013-06-20 09:01:35 UTC (rev 56814)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gis_set.py	2013-06-20 09:10:57 UTC (rev 56815)
@@ -380,8 +380,8 @@
                     try:
                         key, val = line.split(":", 1)
                     except ValueError, e:
-                        sys.stderr.write(_('Invalid line in GISRC file (%s):%s\n' % \
-                                               (e, line)))
+                        sys.stderr.write(_('Invalid line in GISRC file (%(e)s):%(l)s\n' % \
+                                               {'e': e, 'l': line}))
                     grassrc[key.strip()] = DecodeString(val.strip())
             finally:
                 rc.close()

Modified: grass/branches/releasebranch_6_4/gui/wxpython/wxplot/profile.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/wxplot/profile.py	2013-06-20 09:01:35 UTC (rev 56814)
+++ grass/branches/releasebranch_6_4/gui/wxpython/wxplot/profile.py	2013-06-20 09:10:57 UTC (rev 56815)
@@ -353,8 +353,9 @@
                     fd = open(pfile[-1], "w")
                 except IOError, e:
                     GError(parent = self,
-                           message = _("Unable to open file <%s> for writing.\n"
-                                       "Reason: %s") % (pfile[-1], e))
+                           message = _("Unable to open file <%(file)s> for "
+                                       "writing.\nReason: %(e)s") % {'file': pfile[-1],
+                                                                     'e': e})
                     dlg.Destroy()
                     return
                 
@@ -365,7 +366,8 @@
         
         dlg.Destroy()
         if pfile:
-            message = _("%d files created:\n%s") % (len(pfile), '\n'.join(pfile))
+            message = _("%(l)d files created:\n%(p)s") % {'l': len(pfile),
+                                                          'p':'\n'.join(pfile)}
         else:
             message = _("No files generated.")
         



More information about the grass-commit mailing list