[GRASS-SVN] r63591 - grass/trunk/lib/python/script

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Dec 18 07:53:27 PST 2014


Author: martinl
Date: 2014-12-18 07:53:26 -0800 (Thu, 18 Dec 2014)
New Revision: 63591

Modified:
   grass/trunk/lib/python/script/core.py
Log:
fix libpython to handle 'raster' (#2409)


Modified: grass/trunk/lib/python/script/core.py
===================================================================
--- grass/trunk/lib/python/script/core.py	2014-12-18 15:46:36 UTC (rev 63590)
+++ grass/trunk/lib/python/script/core.py	2014-12-18 15:53:26 UTC (rev 63591)
@@ -964,7 +964,7 @@
     temporary region used for raster-based computation.
 
     :param bool region3d: True to get 3D region
-    :param kwargs: g.region's parameters like 'rast', 'vect' or 'region'
+    :param kwargs: g.region's parameters like 'raster', 'vector' or 'region'
 
     ::
 
@@ -1097,9 +1097,9 @@
 
     :return: list of elements
     """
-    if type == 'raster' or type == 'cell':
-        verbose(_('Element type should be "rast" and not "%s"') % type)
-        type = 'rast'
+    if type == 'cell':
+        verbose(_('Element type should be "raster" and not "%s"') % type)
+    
     result = list()
     for line in read_command("g.list",
                              quiet=True,
@@ -1162,9 +1162,9 @@
         store_types = True
         flag += 't'
     for i in range(len(types)):
-        if types[i] == 'raster' or types[i] == 'cell':
-            verbose(_('Element type should be "rast" and not "%s"') % types[i])
-            types[i] = 'rast'
+        if types[i] == 'cell':
+            verbose(_('Element type should be "raster" and not "%s"') % types[i])
+            types[i] = 'raster'
     result = {}
     if check_search_path:
         for mapset in mapsets(search_path=True):



More information about the grass-commit mailing list