Browse Source

pythonlib: _decode - > decode

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@47399 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 14 years ago
parent
commit
709128d4d2
3 changed files with 7 additions and 6 deletions
  1. 1 1
      lib/python/core.py
  2. 5 4
      lib/python/task.py
  3. 1 1
      scripts/v.report/v.report.py

+ 1 - 1
lib/python/core.py

@@ -77,7 +77,7 @@ _popen_args = ["bufsize", "executable", "stdin", "stdout", "stderr",
 	       "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)

+ 5 - 4
lib/python/task.py

@@ -430,11 +430,12 @@ def get_interface_description(cmd):
         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'))
 

+ 1 - 1
scripts/v.report/v.report.py

@@ -35,7 +35,7 @@
 #% description: Data source for OGR access
 #% required: yes
 #%end
-#%option
+#%option G_OPT_V_MAP
 #% key: layer
 #% type: string
 #% answer: 1