[GRASS-SVN] r42584 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jun 17 15:18:20 EDT 2010


Author: martinl
Date: 2010-06-17 19:18:20 +0000 (Thu, 17 Jun 2010)
New Revision: 42584

Modified:
   grass/trunk/gui/wxpython/gui_modules/menudata.py
Log:
fix #1089
(merge r42583 from trunk)


Modified: grass/trunk/gui/wxpython/gui_modules/menudata.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menudata.py	2010-06-17 19:10:20 UTC (rev 42583)
+++ grass/trunk/gui/wxpython/gui_modules/menudata.py	2010-06-17 19:18:20 UTC (rev 42584)
@@ -37,8 +37,11 @@
 except ImportError:
     import elementtree.ElementTree as etree # Python <= 2.4
 
-import globalvar
+if not os.getenv("GISBASE"):
+    sys.exit("GRASS is not running. Exiting...")
 
+etcwxdir = os.path.join(os.getenv("GISBASE"), "etc", "wxpython")
+
 class MenuData:
     """!Abstract menu data class"""
     def __init__(self, filename):
@@ -192,7 +195,8 @@
     def __init__(self, filename = None):
         if not filename:
             gisbase = os.getenv('GISBASE')
-	    filename = os.path.join(globalvar.ETCWXDIR, 'xml', 'menudata.xml')
+            global etcwxdir
+	    filename = os.path.join(etcwxdir, 'xml', 'menudata.xml')
         
         MenuData.__init__(self, filename)
         
@@ -226,7 +230,8 @@
     def __init__(self, filename = None):
         if not filename:
             gisbase = os.getenv('GISBASE')
-	    filename = os.path.join(globalvar.ETCWXDIR, 'xml', 'menudata_modeler.xml')
+            global etcwxdir
+	    filename = os.path.join(etcwxdir, 'xml', 'menudata_modeler.xml')
         
         MenuData.__init__(self, filename)
 



More information about the grass-commit mailing list