[GRASS-SVN] r57803 - in grass/trunk: gui/wxpython/gui_core raster/r.colors tools

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Sep 22 02:11:05 PDT 2013


Author: martinl
Date: 2013-09-22 02:11:04 -0700 (Sun, 22 Sep 2013)
New Revision: 57803

Modified:
   grass/trunk/gui/wxpython/gui_core/widgets.py
   grass/trunk/raster/r.colors/Makefile
   grass/trunk/tools/thumbnails.py
Log:
r.colors: move colortable thumbnails to the separate directory (similarly to barscales)


Modified: grass/trunk/gui/wxpython/gui_core/widgets.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/widgets.py	2013-09-22 09:00:25 UTC (rev 57802)
+++ grass/trunk/gui/wxpython/gui_core/widgets.py	2013-09-22 09:11:04 UTC (rev 57803)
@@ -1247,7 +1247,7 @@
 
     Used in r(3).colors dialog."""
     def _getPath(self, name):
-        return os.path.join(os.getenv("GISBASE"), "docs", "html", "Colortable_%s.png" % name)
+        return os.path.join(os.getenv("GISBASE"), "docs", "html", "colortables", "%s.png" % name)
 
 
 class BarscalesComboBox(PictureComboBox):

Modified: grass/trunk/raster/r.colors/Makefile
===================================================================
--- grass/trunk/raster/r.colors/Makefile	2013-09-22 09:00:25 UTC (rev 57802)
+++ grass/trunk/raster/r.colors/Makefile	2013-09-22 09:11:04 UTC (rev 57803)
@@ -15,19 +15,22 @@
 # Insert thumbnail previews
 r.colors.tmp.html: $(BIN)/r.colors$(EXE) thumbnails
 	$(call htmldesc,$<,$@)
-	sed 's!^<dd><b>\([a-z0-9._]*\)</b>:!<dd><img width="80" height="12" src="Colortable_\1.png"> <b>\1</b>:!' "$@" > "$@.tmp"
+	sed 's!^<dd><b>\([a-z0-9._]*\)</b>:!<dd><img width="80" height="12" src="colortables/\1.png"> <b>\1</b>:!' "$@" > "$@.tmp"
 	mv -f "$@.tmp" "$@"
 	$(MAKE) thumbnails
 
 r3.colors.tmp.html: $(BIN)/r3.colors$(EXE) thumbnails
 	$(call htmldesc,$<,$@)
-	sed 's!^<dd><b>\([a-z0-9._]*\)</b>:!<dd><img width="80" height="12" src="Colortable_\1.png"> <b>\1</b>:!' "$@" > "$@.tmp"
+	sed 's!^<dd><b>\([a-z0-9._]*\)</b>:!<dd><img width="80" height="12" src="colortables/\1.png"> <b>\1</b>:!' "$@" > "$@.tmp"
 	mv -f "$@.tmp" "$@"
 	$(MAKE) thumbnails
 
-thumbnails: $(BIN)/r.mapcalc$(EXE)
+thumbnails: $(BIN)/r.mapcalc$(EXE) $(HTMLDIR)/colortables
 	-$(call run_grass, $(GRASS_HOME)/tools/thumbnails.py)
 
+$(HTMLDIR)/colortables: $(HTMLDIR)
+	$(MKDIR) $@
+
 $(BIN)/r.mapcalc$(EXE):
 	$(MAKE) -C ../r.mapcalc
 

Modified: grass/trunk/tools/thumbnails.py
===================================================================
--- grass/trunk/tools/thumbnails.py	2013-09-22 09:00:25 UTC (rev 57802)
+++ grass/trunk/tools/thumbnails.py	2013-09-22 09:11:04 UTC (rev 57803)
@@ -151,7 +151,7 @@
     grass.run_command("r.colors", map = grad, color = table, quiet = True)
     grass.run_command("d.colortable", flags = 'n', map = grad,
                       lines = lines, cols = cols, quiet = True)
-    outfile = os.path.join(output_dir, "Colortable_%s.png" % table)
+    outfile = os.path.join(output_dir, "colortables", "%s.png" % table)
     convert_and_rotate(tmp_img, outfile, discrete)
 
 def main():



More information about the grass-commit mailing list