[GRASS-SVN] r34942 - grass/branches/releasebranch_6_4/lib/python
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Dec 19 16:39:40 EST 2008
Author: martinl
Date: 2008-12-19 16:39:40 -0500 (Fri, 19 Dec 2008)
New Revision: 34942
Modified:
grass/branches/releasebranch_6_4/lib/python/grass.py
Log:
grass.py synchronized with devbr6
Modified: grass/branches/releasebranch_6_4/lib/python/grass.py
===================================================================
--- grass/branches/releasebranch_6_4/lib/python/grass.py 2008-12-19 20:53:21 UTC (rev 34941)
+++ grass/branches/releasebranch_6_4/lib/python/grass.py 2008-12-19 21:39:40 UTC (rev 34942)
@@ -494,7 +494,7 @@
# run "v.info -c ..." and parse output
def vector_columns(map, layer = None, **args):
- """Return the directory of columns for the database table connected to
+ """Return a dictionary of the columns for the database table connected to
a vector map (interface to `v.info -c').
"""
s = read_command('v.info', flags = 'c', map = map, layer = layer, quiet = True, **args)
@@ -519,9 +519,18 @@
def raster_history(map):
"""Set the command history for a raster map to the command used to
invoke the script (interface to `r.support').
+
+ @return True on success
+ @return False on failure
"""
- run_command('r.support', map = map, history = os.environ['CMDLINE'])
-
+ current_mapset = gisenv()['MAPSET']
+ if find_file(name = map)['mapset'] == current_mapset:
+ run_command('r.support', map = map, history = os.environ['CMDLINE'])
+ return True
+
+ warning("Unable to write history for <%s>. Raster map <%s> not found in current mapset." % (map, map))
+ return False
+
# run "r.info -rgstmpud ..." and parse output
def raster_info(map):
More information about the grass-commit
mailing list