[GRASS-SVN] r51172 - grass/trunk/lib/python

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Mar 28 06:28:16 EDT 2012


Author: lucadelu
Date: 2012-03-28 03:28:15 -0700 (Wed, 28 Mar 2012)
New Revision: 51172

Modified:
   grass/trunk/lib/python/core.py
Log:
rast, raster and cell can be used in all the function that search raster maps

Modified: grass/trunk/lib/python/core.py
===================================================================
--- grass/trunk/lib/python/core.py	2012-03-28 08:11:34 UTC (rev 51171)
+++ grass/trunk/lib/python/core.py	2012-03-28 10:28:15 UTC (rev 51172)
@@ -723,6 +723,9 @@
 
     @return parsed output of g.findfile
     """
+    if element == 'raster' or element == 'rast':
+        verbose(_('Element type should be "cell" and not "%s"') % element)
+        element = 'cell'
     s = read_command("g.findfile", flags='n', element = element, file = name, mapset = mapset)
     return parse_key_val(s)
 
@@ -745,6 +748,9 @@
 
     @return directory of mapsets/elements
     """
+    if type == 'raster' or type == 'cell':
+        verbose(_('Element type should be "rast" and not "%s"') % element)
+        type = 'rast'
     dashes_re = re.compile("^----+$")
     mapset_re = re.compile("<(.*)>")
     result = {}
@@ -825,6 +831,9 @@
 
     @return list of elements
     """
+    if type == 'raster' or type == 'cell':
+        verbose(_('Element type should be "rast" and not "%s"') % element)
+        type = 'rast'
     result = list()
     for line in read_command("g.mlist",
                              quiet = True,
@@ -870,6 +879,9 @@
 
     @return directory of mapsets/elements
     """
+    if type == 'raster' or type == 'cell':
+        verbose(_('Element type should be "rast" and not "%s"') % element)
+        type = 'rast'
     result = {}
     if check_search_path:
         for mapset in mapsets(search_path = True):



More information about the grass-commit mailing list