瀏覽代碼

Add missing keywords
Update menu (remove disabled modules)


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@37809 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 16 年之前
父節點
當前提交
ea90ac0363

+ 15 - 3
gui/wxpython/support/update_menudata.py

@@ -57,16 +57,24 @@ def parseModules():
 
 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 updateData(data, modules):
 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 @@ if __name__ == '__main__':
         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

+ 1 - 62
gui/wxpython/xml/menudata.xml

@@ -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>

+ 1 - 0
raster/r.support.stats/main.c

@@ -35,6 +35,7 @@ int main(int argc, char *argv[])
 
     module = G_define_module();
     module->description = _("Update raster map statistics");
+    module->keywords = _("raster, statistics");
 
     parm.raster = G_define_standard_option(G_OPT_R_MAP);
 

+ 1 - 0
raster/r.terraflow/main.cc

@@ -450,6 +450,7 @@ main(int argc, char *argv[]) {
 #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));

+ 3 - 2
raster/r.water.outlet/main.c

@@ -61,7 +61,8 @@ int main(int argc, char *argv[])
 
     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 @@ int main(int argc, char *argv[])
     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];
 	}