[GRASS-SVN] r47401 - grass/branches/develbranch_6/lib/python

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Aug 3 14:29:20 EDT 2011


Author: martinl
Date: 2011-08-03 11:29:20 -0700 (Wed, 03 Aug 2011)
New Revision: 47401

Modified:
   grass/branches/develbranch_6/lib/python/core.py
   grass/branches/develbranch_6/lib/python/task.py
Log:
pythonlib: _decode - > decode


Modified: grass/branches/develbranch_6/lib/python/core.py
===================================================================
--- grass/branches/develbranch_6/lib/python/core.py	2011-08-03 18:28:45 UTC (rev 47400)
+++ grass/branches/develbranch_6/lib/python/core.py	2011-08-03 18:29:20 UTC (rev 47401)
@@ -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/develbranch_6/lib/python/task.py
===================================================================
--- grass/branches/develbranch_6/lib/python/task.py	2011-08-03 18:28:45 UTC (rev 47400)
+++ grass/branches/develbranch_6/lib/python/task.py	2011-08-03 18:29:20 UTC (rev 47401)
@@ -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