[GRASS-SVN] r37810 - in grass/trunk/gui/wxpython: support xml

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Jun 10 16:12:24 EDT 2009


Author: martinl
Date: 2009-06-10 16:12:24 -0400 (Wed, 10 Jun 2009)
New Revision: 37810

Modified:
   grass/trunk/gui/wxpython/support/update_menudata.py
   grass/trunk/gui/wxpython/xml/menudata.xml
Log:
wxGUI: keywords updated in the menu


Modified: grass/trunk/gui/wxpython/support/update_menudata.py
===================================================================
--- grass/trunk/gui/wxpython/support/update_menudata.py	2009-06-10 20:01:45 UTC (rev 37809)
+++ grass/trunk/gui/wxpython/support/update_menudata.py	2009-06-10 20:12:24 UTC (rev 37810)
@@ -86,10 +86,14 @@
         else:
             desc = modules[module]['desc']
         node.find('help').text = desc
-        if node.find('keywords') is not None:
+
+        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'])
-        else:
-            grass.warning('%s: keywords missing' % module)
         
 def writeData(data):
     """!Write updated menudata.xml"""

Modified: grass/trunk/gui/wxpython/xml/menudata.xml
===================================================================
--- grass/trunk/gui/wxpython/xml/menudata.xml	2009-06-10 20:01:45 UTC (rev 37809)
+++ grass/trunk/gui/wxpython/xml/menudata.xml	2009-06-10 20:12:24 UTC (rev 37810)
@@ -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>



More information about the grass-commit mailing list