Explorar o código

wxGUI: keywords updated in the menu

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@37810 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa %!s(int64=16) %!d(string=hai) anos
pai
achega
f6ce931836
Modificáronse 2 ficheiros con 11 adicións e 3 borrados
  1. 7 3
      gui/wxpython/support/update_menudata.py
  2. 4 0
      gui/wxpython/xml/menudata.xml

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

@@ -86,10 +86,14 @@ def updateData(data, modules):
         else:
             desc = modules[module]['desc']
         node.find('help').text = desc
-        if node.find('keywords') is not None:
-            node.find('keywords').text = ','.join(modules[module]['keywords'])
-        else:
+
+        if not modules[module].has_key('keywords'):
             grass.warning('%s: keywords missing' % module)
+        else:
+            if node.find('keywords') is None:
+                node.insert(2, etree.Element('keywords'))
+                grass.warning("Adding tag 'keywords' to '%s'" % module)
+            node.find('keywords').text = ','.join(modules[module]['keywords'])
         
 def writeData(data):
     """!Write updated menudata.xml"""

+ 4 - 0
gui/wxpython/xml/menudata.xml

@@ -592,6 +592,7 @@
 	<menuitem>
 	  <label>NVIZ (requires Tcl/Tk)</label>
 	  <help>nviz - Visualization and animation tool for GRASS data.</help>
+	  <keywords>raster,vector,visualization</keywords>
 	  <handler>self.OnMenuCmd</handler>
 	  <command>nviz</command>
 	</menuitem>
@@ -805,6 +806,7 @@
 	    <menuitem>
 	      <label>Update map statistics</label>
 	      <help>Update raster map statistics</help>
+	      <keywords>raster,statistics</keywords>
 	      <handler>self.OnMenuCmd</handler>
 	      <command>r.support.stats</command>
 	    </menuitem>
@@ -1121,6 +1123,7 @@
 	    <menuitem>
 	      <label>Flow accumulation</label>
 	      <help>Flow computation for massive grids (Float version).</help>
+	      <keywords>raster</keywords>
 	      <handler>self.OnMenuCmd</handler>
 	      <command>r.terraflow</command>
 	    </menuitem>
@@ -1179,6 +1182,7 @@
 	    <menuitem>
 	      <label>Watershed basin creation</label>
 	      <help>Watershed basin creation program.</help>
+	      <keywords>raster</keywords>
 	      <handler>self.OnMenuCmd</handler>
 	      <command>r.water.outlet</command>
 	    </menuitem>