[GRASS-SVN] r37809 - in grass/trunk: gui/wxpython/support gui/wxpython/xml raster/r.support.stats raster/r.terraflow raster/r.water.outlet

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Jun 10 16:01:45 EDT 2009


Author: martinl
Date: 2009-06-10 16:01:45 -0400 (Wed, 10 Jun 2009)
New Revision: 37809

Modified:
   grass/trunk/gui/wxpython/support/update_menudata.py
   grass/trunk/gui/wxpython/xml/menudata.xml
   grass/trunk/raster/r.support.stats/main.c
   grass/trunk/raster/r.terraflow/main.cc
   grass/trunk/raster/r.water.outlet/main.c
Log:
Add missing keywords
Update menu (remove disabled modules)


Modified: grass/trunk/gui/wxpython/support/update_menudata.py
===================================================================
--- grass/trunk/gui/wxpython/support/update_menudata.py	2009-06-10 18:03:00 UTC (rev 37808)
+++ grass/trunk/gui/wxpython/support/update_menudata.py	2009-06-10 20:01:45 UTC (rev 37809)
@@ -57,16 +57,24 @@
 
 def updateData(data, modules):
     """!Update menu data tree"""
+    # list of modules to be ignored
+    ignore =  [ 'v.type_wrapper.py',
+                'vcolors' ]
+    
+
     for node in data.tree.getiterator():
         if node.tag != 'menuitem':
             continue
-        
+
         item = dict()
         for child in node.getchildren():
             item[child.tag] = child.text
         
         if not item.has_key('command'):
             continue
+
+        if item['command'] in ignore:
+            continue
         
         module = item['command'].split(' ')[0]
         if not modules.has_key(module):
@@ -86,7 +94,11 @@
 def writeData(data):
     """!Write updated menudata.xml"""
     file = os.path.join('..', 'xml', 'menudata.xml')
-    data.tree.write(file)
+    try:
+        data.tree.write(file)
+    except IOError:
+        print >> sys.stderr, "'menudata.xml' not found. Please run the script from 'gui/wxpython/support'."
+        
 
 def main(argv = None):
     if argv is None:
@@ -113,7 +125,7 @@
         print >> sys.stderr, "You must be in GRASS GIS to run this program."
         sys.exit(1)
     
-    sys.path.append('../gui_modules')
+    sys.path.append(os.path.join(os.getenv("GISBASE"), 'etc', 'wxpython', 'gui_modules'))
     import menudata
     import menuform
     import globalvar

Modified: grass/trunk/gui/wxpython/xml/menudata.xml
===================================================================
--- grass/trunk/gui/wxpython/xml/menudata.xml	2009-06-10 18:03:00 UTC (rev 37808)
+++ grass/trunk/gui/wxpython/xml/menudata.xml	2009-06-10 20:01:45 UTC (rev 37809)
@@ -591,7 +591,7 @@
 	<separator />
 	<menuitem>
 	  <label>NVIZ (requires Tcl/Tk)</label>
-	  <help>nviz - Visualization and animation tool for GRASS data</help>
+	  <help>nviz - Visualization and animation tool for GRASS data.</help>
 	  <handler>self.OnMenuCmd</handler>
 	  <command>nviz</command>
 	</menuitem>
@@ -1133,19 +1133,6 @@
 	    </menuitem>
 	    <separator />
 	    <menuitem>
-	      <label>SIMWE Overland flow modeling</label>
-	      <help>Overland flow hydrologic simulation using path sampling method (SIMWE)</help>
-	      <handler>self.OnMenuCmd</handler>
-	      <command>r.sim.water</command>
-	    </menuitem>
-	    <menuitem>
-	      <label>SIMWE Sediment flux modeling</label>
-	      <help>Sediment transport and erosion/deposition simulation using path sampling method (SIMWE)</help>
-	      <handler>self.OnMenuCmd</handler>
-	      <command>r.sim.sediment</command>
-	    </menuitem>
-	    <separator />
-	    <menuitem>
 	      <label>Topographic index map</label>
 	      <help>Creates topographic index [ln(a/tan(beta))] map from elevation map.</help>
 	      <keywords>raster</keywords>
@@ -1198,30 +1185,6 @@
 	  </items>
 	</menu>
 	<menu>
-	  <label>Landscape structure modeling</label>
-	  <items>
-
-	    <menuitem>
-	      <label>Analyze landscape</label>
-	      <help>Contains a set of measures for attributes, diversity, texture, juxtaposition, and edge.</help>
-	      <handler>self.OnMenuCmd</handler>
-	      <command>r.le.pixel</command>
-	    </menuitem>
-	    <menuitem>
-	      <label>Analyze patches</label>
-	      <help>Calculates attribute, patch size, core (interior) size, shape, fractal dimension, and perimeter measures for sets of patches in a landscape.</help>
-	      <handler>self.OnMenuCmd</handler>
-	      <command>r.le.patch</command>
-	    </menuitem>
-	    <menuitem>
-	      <label>Output</label>
-	      <help>Displays the boundary of each r.le patch and shows how the boundary is traced, displays the attribute, size, perimeter and shape indices for each patch and saves the data in an output file.</help>
-	      <handler>self.OnMenuCmd</handler>
-	      <command>r.le.trace</command>
-	    </menuitem>
-	  </items>
-	</menu>
-	<menu>
 	  <label>Landscape patch analysis</label>
 	  <items>
 	    <menuitem>
@@ -1395,12 +1358,6 @@
               <handler>self.RulesCmd</handler>
 	      <command>r.recode</command>
 	    </menuitem>
-	    <menuitem>
-	      <label>Recode using rules file</label>
-	      <help>r.recode.rules - Use ascii rules file to recode categories in raster map</help>
-	      <handler>self.OnMenuCmd</handler>
-	      <command>r.recode.file</command>
-	    </menuitem>
 	    <separator />
 	    <menuitem>
 	      <label>Rescale</label>
@@ -1506,12 +1463,6 @@
 	  <label>Interpolate surfaces</label>
 	  <items>
 	    <menuitem>
-	      <label>Bilinear from raster points</label>
-	      <help>Bilinear interpolation utility for raster map layers.</help>
-	      <handler>self.OnMenuCmd</handler>
-	      <command>r.bilinear</command>
-	    </menuitem>
-	    <menuitem>
 	      <label>Bilinear and bicubic from vector points</label>
 	      <help>Bicubic or bilinear spline interpolation with Tykhonov regularization.</help>
 	      <keywords>vector,interpolation</keywords>
@@ -1599,12 +1550,6 @@
 	      <command>r.describe</command>
 	    </menuitem>
 	    <menuitem>
-	      <label>Sum category values</label>
-	      <help>Sums up the raster cell values.</help>
-	      <handler>self.OnMenuCmd</handler>
-	      <command>r.sum</command>
-	    </menuitem>
-	    <menuitem>
 	      <label>Sum area by raster map and category</label>
 	      <help>Reports statistics for raster map layers.</help>
 	      <keywords>raster,statistics</keywords>
@@ -2372,12 +2317,6 @@
               <handler>self.OnMenuCmd</handler>
 	      <command>i.zc</command>
 	    </menuitem>
-	    <menuitem>
-	      <label>Matrix/convolving filter</label>
-	      <help>Raster map matrix filter.</help>
-	      <handler>self.OnMenuCmd</handler>
-	      <command>r.mfilter.fp</command>
-	    </menuitem>
 	  </items>
 	</menu>
 	<menuitem>

Modified: grass/trunk/raster/r.support.stats/main.c
===================================================================
--- grass/trunk/raster/r.support.stats/main.c	2009-06-10 18:03:00 UTC (rev 37808)
+++ grass/trunk/raster/r.support.stats/main.c	2009-06-10 20:01:45 UTC (rev 37809)
@@ -35,6 +35,7 @@
 
     module = G_define_module();
     module->description = _("Update raster map statistics");
+    module->keywords = _("raster, statistics");
 
     parm.raster = G_define_standard_option(G_OPT_R_MAP);
 

Modified: grass/trunk/raster/r.terraflow/main.cc
===================================================================
--- grass/trunk/raster/r.terraflow/main.cc	2009-06-10 18:03:00 UTC (rev 37808)
+++ grass/trunk/raster/r.terraflow/main.cc	2009-06-10 20:01:45 UTC (rev 37809)
@@ -450,6 +450,7 @@
 #ifdef ELEV_FLOAT
   module->description = _("Flow computation for massive grids (Float version).");
 #endif
+  module->keywords = _("raster");
 
   /* read user options; fill in global <opt> */  
   opt = (userOptions*)malloc(sizeof(userOptions));

Modified: grass/trunk/raster/r.water.outlet/main.c
===================================================================
--- grass/trunk/raster/r.water.outlet/main.c	2009-06-10 18:03:00 UTC (rev 37808)
+++ grass/trunk/raster/r.water.outlet/main.c	2009-06-10 20:01:45 UTC (rev 37809)
@@ -61,7 +61,8 @@
 
     module = G_define_module();
     module->description = _("Watershed basin creation program.");
-
+    module->keywords = _("raster");
+    
     opt1 = G_define_option();
     opt1->key = "drainage";
     opt1->type = TYPE_STRING;
@@ -138,7 +139,7 @@
     for (row = 0; row < nrows; row++) {
 	G_get_map_row(drain_fd, cell_buf, row);
 	for (col = 0; col < ncols; col++) {
-	    if (cell_buf[col] == 0)
+	    if (cell_buf[col] == 0) 
 		total--;
 	    drain_ptrs[SEG_INDEX(pt_seg, row, col)] = cell_buf[col];
 	}



More information about the grass-commit mailing list