[GRASS-SVN] r41278 - grass/trunk/scripts/v.colors

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Mar 3 20:47:11 EST 2010


Author: hamish
Date: 2010-03-03 20:47:10 -0500 (Wed, 03 Mar 2010)
New Revision: 41278

Modified:
   grass/trunk/scripts/v.colors/v.colors.py
Log:
fix verbosity

Modified: grass/trunk/scripts/v.colors/v.colors.py
===================================================================
--- grass/trunk/scripts/v.colors/v.colors.py	2010-03-04 01:36:03 UTC (rev 41277)
+++ grass/trunk/scripts/v.colors/v.colors.py	2010-03-04 01:47:10 UTC (rev 41278)
@@ -135,8 +135,6 @@
     tmp_colr = None
     tmp_vcol = None
 
-    os.environ['GRASS_VERBOSE'] = '0'
-
     kv = grass.gisenv()
     mapset = kv['MAPSET']
     gisbase = os.getenv('GISBASE')
@@ -216,7 +214,7 @@
     minval = min(vals)
     maxval = max(vals)
 
-    grass.message(_(" min=[%s]  max=[$%s]") % (minval, maxval))
+    grass.verbose(_(" min=[%s]  max=[$%s]") % (minval, maxval))
     if not minval or not maxval:
 	grass.fatal(_("Scanning data range"))
 
@@ -246,7 +244,7 @@
     else:
 	flip_flag = ''
 
-    grass.run_command('r.colors', map = tmp_colr, flags = flip_flag, **color_cmd)
+    grass.run_command('r.colors', map = tmp_colr, flags = flip_flag, **color_cmd, quiet = True)
 
     tmp = grass.tempfile()
 
@@ -274,7 +272,7 @@
 	colr = colr.strip()
 	if len(colr.split(':')) != 3:
 	    continue
-	#g.message message="LINE=[$LINE]"
+	#grass.debug('LINE=[%s]' % line)
 	fo.write(t.substitute(table = table, rgb_column = rgb_column, colr = colr, value = value))
 	found += 1
     fi.close()
@@ -291,7 +289,7 @@
 
     if flags['s']:
 	vcolors = "vcolors_%d" % pid
-	grass.run_command('g.rename', rast = (tmp_colr, vcolors))
+	grass.run_command('g.rename', rast = (tmp_colr, vcolors), quiet = True)
 	grass.message(_("Raster map containing color rules saved to <%s>") % vcolors)
 	# TODO save full v.colors command line history
 	grass.run_command('r.support', map = vcolors,
@@ -303,7 +301,7 @@
 	grass.run_command('r.support', map = vcolors,
 			  history = "RGB saved into <%s> using <%s%s%s>" % (rgb_column, color, raster, rules))
     else:
-	grass.run_command('g.remove', rast = tmp_colr)
+	grass.run_command('g.remove', rast = tmp_colr, quiet = True)
 
     #v.db.dropcolumn map=vcol_test col=GRASSRGB
     #d.vect -a vcol_test icon=basic/circle color=none size=8



More information about the grass-commit mailing list