[GRASS-SVN] r41551 - grass/trunk/gui/wxpython/support

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Mar 26 05:46:18 EDT 2010


Author: martinl
Date: 2010-03-26 05:45:59 -0400 (Fri, 26 Mar 2010)
New Revision: 41551

Modified:
   grass/trunk/gui/wxpython/support/update_menudata.py
Log:
'make' required


Modified: grass/trunk/gui/wxpython/support/update_menudata.py
===================================================================
--- grass/trunk/gui/wxpython/support/update_menudata.py	2010-03-26 09:37:45 UTC (rev 41550)
+++ grass/trunk/gui/wxpython/support/update_menudata.py	2010-03-26 09:45:59 UTC (rev 41551)
@@ -55,16 +55,16 @@
         modules[interface.name] = { 'label'   : interface.label,
                                     'desc'    : interface.description,
                                     'keywords': interface.keywords }
-    
+        
     return modules
 
 def updateData(data, modules):
     """!Update menu data tree"""
     # list of modules to be ignored
-    ignore =  [ 'v.type_wrapper.py',
-                'vcolors' ]
+    ignore = ['v.type_wrapper.py',
+              'vcolors']
     
-    menu_modules = []
+    menu_modules = list()
     for node in data.tree.getiterator():
         if node.tag != 'menuitem':
             continue
@@ -75,7 +75,7 @@
         
         if not item.has_key('command'):
             continue
-
+        
         if item['command'] in ignore:
             continue
         
@@ -89,7 +89,7 @@
         else:
             desc = modules[module]['desc']
         node.find('help').text = desc
-
+        
         if not modules[module].has_key('keywords'):
             grass.warning('%s: keywords missing' % module)
         else:
@@ -137,33 +137,34 @@
         print >> sys.stderr, __doc__
         return 1
     
-    grass.info("Step 1: parsing modules...")
+    nuldev = file(os.devnull, 'w+')
+    grass.info("Step 1: running make...")
+    grass.call(['make'], stderr = nuldev)
+    grass.info("Step 2: parsing modules...")
     modules = dict()
     modules = parseModules()
-    grass.info("Step 2: reading menu data...")
+    grass.info("Step 3: reading menu data...")
     data = menudata.Data()
-    grass.info("Step 3: updating menu data...")
+    grass.info("Step 4: updating menu data...")
     updateData(data, modules)
-
+    
     if printDiff:
         tempFile = tempfile.NamedTemporaryFile()
-        grass.info("Step 4: writing menu data...")
+        grass.info("Step 5: diff menu data...")
         writeData(data, tempFile.name)
         
-        nuldev = file(os.devnull, 'w+')
         grass.call(['diff', '-u',
                     os.path.join('xml', 'menudata.xml'),
                     tempFile.name], stderr = nuldev)
     else:
-        grass.info("Step 4: writing menu data (menudata.xml)...")
+        grass.info("Step 5: writing menu data (menudata.xml)...")
         writeData(data)
         
     return 0
 
 if __name__ == '__main__':
     if os.getenv("GISBASE") is None:
-        print >> sys.stderr, "You must be in GRASS GIS to run this program."
-        sys.exit(1)
+        sys.exit("You must be in GRASS GIS to run this program.")
     
     sys.path.append(os.path.join(os.getenv("GISBASE"), 'etc', 'wxpython', 'gui_modules'))
     import menudata



More information about the grass-commit mailing list