[GRASS-SVN] r47405 - grass/branches/releasebranch_6_4/lib/python

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Aug 3 15:58:22 EDT 2011


Author: martinl
Date: 2011-08-03 12:58:22 -0700 (Wed, 03 Aug 2011)
New Revision: 47405

Modified:
   grass/branches/releasebranch_6_4/lib/python/core.py
   grass/branches/releasebranch_6_4/lib/python/task.py
Log:
pythonlib: _decode - > decode
	   (merge r47401 from devbr6)


Modified: grass/branches/releasebranch_6_4/lib/python/core.py
===================================================================
--- grass/branches/releasebranch_6_4/lib/python/core.py	2011-08-03 19:11:55 UTC (rev 47404)
+++ grass/branches/releasebranch_6_4/lib/python/core.py	2011-08-03 19:58:22 UTC (rev 47405)
@@ -77,7 +77,7 @@
 	       "preexec_fn", "close_fds", "cwd", "env",
 	       "universal_newlines", "startupinfo", "creationflags"]
 
-def _decode(string):
+def decode(string):
     enc = locale.getdefaultlocale()[1]
     if enc:
         return string.decode(enc)

Modified: grass/branches/releasebranch_6_4/lib/python/task.py
===================================================================
--- grass/branches/releasebranch_6_4/lib/python/task.py	2011-08-03 19:11:55 UTC (rev 47404)
+++ grass/branches/releasebranch_6_4/lib/python/task.py	2011-08-03 19:58:22 UTC (rev 47405)
@@ -430,11 +430,12 @@
         cmdout, cmderr = Popen([cmd, '--interface-description'], stdout = PIPE,
                                      stderr = PIPE).communicate()
     except OSError, e:
-        raise ScriptError, _("Unable to fetch interface description for command '%s'.") % cmd + \
-            _("Details:") +  "%s" % e
+        raise ScriptError, _("Unable to fetch interface description for command '%s'."
+                             "\n\nDetails: %s") % (cmd, e)
+    
     if cmderr and cmderr[:7] != 'WARNING':
-        raise ScriptError, _("Unable to fetch interface description for command '%s'.") % cmd + \
-            _("Details:") + " %s" % cmderr
+        raise ScriptError, _("Unable to fetch interface description for command '%s'."
+                             "\n\nDetails: %s") % (cmd, decode(cmderr))
     
     return cmdout.replace('grass-interface.dtd', os.path.join(os.getenv('GISBASE'), 'etc', 'grass-interface.dtd'))
 



More information about the grass-commit mailing list