[GRASS-SVN] r34829 - in grass/trunk/gui/wxpython: . gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Dec 11 13:05:44 EST 2008


Author: martinl
Date: 2008-12-11 13:05:44 -0500 (Thu, 11 Dec 2008)
New Revision: 34829

Modified:
   grass/trunk/gui/wxpython/Makefile
   grass/trunk/gui/wxpython/gui_modules/menudata.py
Log:
fix wxGUI compilation (merge from devbr6)

Modified: grass/trunk/gui/wxpython/Makefile
===================================================================
--- grass/trunk/gui/wxpython/Makefile	2008-12-11 14:03:41 UTC (rev 34828)
+++ grass/trunk/gui/wxpython/Makefile	2008-12-11 18:05:44 UTC (rev 34829)
@@ -30,4 +30,4 @@
 	$(INSTALL_DATA) $< $@
 
 menustrings.py: gui_modules/menudata.py xml/menudata.xml
-	python $< > $@
+	python $< $(GISBASE) > $@

Modified: grass/trunk/gui/wxpython/gui_modules/menudata.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menudata.py	2008-12-11 14:03:41 UTC (rev 34828)
+++ grass/trunk/gui/wxpython/gui_modules/menudata.py	2008-12-11 18:05:44 UTC (rev 34829)
@@ -25,8 +25,10 @@
 
 class Data:
     '''Data object that returns menu descriptions to be used in wxgui.py.'''
-    def __init__(self):
-	filename = os.getenv('GISBASE') + '/etc/wxpython/xml/menudata.xml'
+    def __init__(self, gisbase=None):
+        if not gisbase:
+            gisbase = os.getenv('GISBASE')
+	filename = gisbase + '/etc/wxpython/xml/menudata.xml'
 	self.tree = etree.parse(filename)
 
     def getMenuItem(self, mi):
@@ -70,4 +72,9 @@
 
 if __name__ == "__main__":
     import sys
-    Data().PrintStrings(sys.stdout)
+    if len(sys.argv) < 2:
+        sys.exit(1)
+    
+    Data(sys.argv[1]).PrintStrings(sys.stdout)
+    
+    sys.exit(0)



More information about the grass-commit mailing list