Jelajahi Sumber

wxGUI: don't fail on missing grass.lib

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@42430 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 15 tahun lalu
induk
melakukan
7c85652ea7
1 mengubah file dengan 8 tambahan dan 3 penghapusan
  1. 8 3
      gui/wxpython/gui_modules/wxnviz.py

+ 8 - 3
gui/wxpython/gui_modules/wxnviz.py

@@ -18,12 +18,17 @@ for details.
 @author Pythonized by Glynn Clements
 @author Pythonized by Glynn Clements
 """
 """
 
 
+import sys
 from threading import Thread
 from threading import Thread
 
 
 from ctypes import *
 from ctypes import *
-from grass.lib.grass import *
-from grass.lib.ogsf  import *
-from grass.lib.nviz  import *
+try:
+    from grass.lib.grass import *
+    from grass.lib.ogsf  import *
+    from grass.lib.nviz  import *
+except ImportError, e:
+    print >> sys.stderr, "\nWARNING: Nviz extension (3D view mode) disabled. Reason: %s" % e
+    sys.stderr.flush()
 
 
 from debug import Debug
 from debug import Debug