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

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Mar 24 16:47:33 EDT 2008


Author: martinl
Date: 2008-03-24 16:47:33 -0400 (Mon, 24 Mar 2008)
New Revision: 30715

Modified:
   grass/trunk/gui/wxpython/support/update_menu_desc.py
Log:
wxGUI (support/update_menu_desc.py) some minor changes in code (check for GISBASE)

Modified: grass/trunk/gui/wxpython/support/update_menu_desc.py
===================================================================
--- grass/trunk/gui/wxpython/support/update_menu_desc.py	2008-03-24 17:32:22 UTC (rev 30714)
+++ grass/trunk/gui/wxpython/support/update_menu_desc.py	2008-03-24 20:47:33 UTC (rev 30715)
@@ -18,19 +18,12 @@
 
 import os
 import sys
-### i18N
-import gettext
-gettext.install('grasswxpy', os.path.join(os.getenv("GISBASE"), 'locale'), unicode=True)
 
 import xml.sax
 import xml.sax.handler
 HandlerBase=xml.sax.handler.ContentHandler
 from xml.sax import make_parser
 
-sys.path.append('../gui_modules')
-import menudata
-import menuform
-
 def read_menudata():
     menu = menudata.Data() # get menu data
     for mainItem in menu.GetMenu()[0]:
@@ -88,9 +81,23 @@
 
     if len(argv) != 1:
         print >> sys.stderr, __doc__
-        sys.exit()
+        return 0
 
+    ### i18N
+    import gettext
+    gettext.install('grasswxpy', os.path.join(os.getenv("GISBASE"), 'locale'), unicode=True)
+
     read_menudata()
 
+    return 0
+
 if __name__ == '__main__':
-    main()
+    if os.getenv("GISBASE") is None:
+        print >> sys.stderr, "You must be in GRASS GIS to run this program."
+        sys.exit(1)
+
+    sys.path.append('../gui_modules')
+    import menudata
+    import menuform
+
+    sys.exit(main())



More information about the grass-commit mailing list