Quellcode durchsuchen

rast, raster and cell can be used in all the function that search raster maps

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@51172 15284696-431f-4ddb-bdfa-cd5b030d7da7
Luca Delucchi vor 13 Jahren
Ursprung
Commit
b558e22bda
1 geänderte Dateien mit 12 neuen und 0 gelöschten Zeilen
  1. 12 0
      lib/python/core.py

+ 12 - 0
lib/python/core.py

@@ -723,6 +723,9 @@ def find_file(name, element = 'cell', mapset = None):
 
     @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 @@ def list_grouped(type, check_search_path = True):
 
     @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 @@ def mlist_strings(type, pattern = None, mapset = None, flag = ''):
 
     @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 @@ def mlist_grouped(type, pattern = None, check_search_path = True, flag = ''):
 
     @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):