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

svn_grass at osgeo.org svn_grass at osgeo.org
Tue May 4 07:32:12 EDT 2010


Author: martinl
Date: 2010-05-04 07:32:12 -0400 (Tue, 04 May 2010)
New Revision: 42108

Modified:
   grass/trunk/gui/wxpython/gui_modules/globalvar.py
Log:
more wxGUI compilation fixes
(merge r42107 from devbr6)


Modified: grass/trunk/gui/wxpython/gui_modules/globalvar.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/globalvar.py	2010-05-04 11:28:01 UTC (rev 42107)
+++ grass/trunk/gui/wxpython/gui_modules/globalvar.py	2010-05-04 11:32:12 UTC (rev 42108)
@@ -22,6 +22,11 @@
 import gettext
 gettext.install('grasswxpy', os.path.join(os.getenv("GISBASE"), 'locale'), unicode=True)
 
+# path to python scripts
+ETCDIR = os.path.join(os.getenv("GISBASE"), "etc")
+ETCICONDIR = os.path.join(os.getenv("GISBASE"), "etc", "gui", "icons")
+ETCWXDIR = os.path.join(ETCDIR, "wxpython")
+
 sys.path.append(os.path.join(ETCDIR, "python"))
 import grass.script as grass
 
@@ -78,11 +83,6 @@
 # temporal query layer (removed on re-render action)
 QUERYLAYER = 'qlayer'
 
-# path to python scripts
-ETCDIR = os.path.join(os.getenv("GISBASE"), "etc")
-ETCICONDIR = os.path.join(os.getenv("GISBASE"), "etc", "gui", "icons")
-ETCWXDIR = os.path.join(ETCDIR, "gui", "wxpython")
-
 """!Style definition for FlatNotebook pages"""
 FNPageStyle = FN.FNB_VC8 | \
     FN.FNB_BACKGROUND_GRADIENT | \
@@ -161,6 +161,9 @@
 
 def _getGDALFormats():
     """!Get dictionary of avaialble GDAL drivers"""
+    if not grass.find_program('r.in.gdal'):
+        return _parseFormats(None)
+    
     ret = grass.read_command('r.in.gdal',
                              quiet = True,
                              flags = 'f')
@@ -169,6 +172,9 @@
 
 def _getOGRFormats():
     """!Get dictionary of avaialble OGR drivers"""
+    if not grass.find_program('v.in.ogr'):
+        return _parseFormats(None)
+    
     ret = grass.read_command('v.in.ogr',
                              quiet = True,
                              flags = 'f')



More information about the grass-commit mailing list