Explorar o código

r.tileset: catch m.proj error if the proj string is wrong

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@62924 15284696-431f-4ddb-bdfa-cd5b030d7da7
Luca Delucchi %!s(int64=10) %!d(string=hai) anos
pai
achega
008ec39da5
Modificáronse 1 ficheiros con 11 adicións e 7 borrados
  1. 11 7
      scripts/r.tileset/r.tileset.py

+ 11 - 7
scripts/r.tileset/r.tileset.py

@@ -113,6 +113,7 @@ import math
 
 from grass.script.utils import separator
 from grass.script import core as grass
+from grass.exceptions import CalledModuleError
 
 
 def bboxToPoints(bbox):
@@ -156,13 +157,16 @@ def project(file, source, dest):
     """Projects point (x, y) using projector"""
     errors = 0
     points = []
-    ret = grass.read_command('m.proj',
-                             quiet=True,
-                             flags='d',
-                             proj_in=source['proj'],
-                             proj_out=dest['proj'],
-                             sep=';',
-                             input=file)
+    try:
+        ret = grass.read_command('m.proj',
+                                 quiet=True,
+                                 flags='d',
+                                 proj_in=source['proj'],
+                                 proj_out=dest['proj'],
+                                 sep=';',
+                                 input=file)
+    except CalledModuleError:
+        grass.fatal(cs2cs + ' failed')
 
     if not ret:
         grass.fatal(cs2cs + ' failed')