[GRASS-SVN] r42583 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jun 17 15:10:21 EDT 2010


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

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/menudata.py
Log:
fix #1089


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/menudata.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menudata.py	2010-06-17 18:47:08 UTC (rev 42582)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menudata.py	2010-06-17 19:10:20 UTC (rev 42583)
@@ -36,8 +36,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):
@@ -191,7 +194,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)
         
@@ -225,7 +229,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