Преглед на файлове

wxGUI: do not crash when numpy is missing

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@58702 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa преди 11 години
родител
ревизия
c9573fbe49
променени са 5 файла, в които са добавени 21 реда и са изтрити 5 реда
  1. 5 1
      gui/wxpython/gui_core/gselect.py
  2. 4 1
      gui/wxpython/wxplot/base.py
  3. 4 1
      gui/wxpython/wxplot/histogram.py
  4. 4 1
      gui/wxpython/wxplot/profile.py
  5. 4 1
      gui/wxpython/wxplot/scatter.py

+ 5 - 1
gui/wxpython/gui_core/gselect.py

@@ -51,7 +51,11 @@ from core import globalvar
 
 import grass.script as grass
 from   grass.script import task as gtask
-from grass.pygrass import messages
+try:
+    from grass.pygrass import messages
+except ImportError, e:
+    print >> sys.stderr, _("Unable to import pyGRASS: %s\n"
+                           "Some functionality will be not accessible") % e
 import grass.temporal as tgis
 
 from gui_core.widgets  import ManageSettingsWidget

+ 4 - 1
gui/wxpython/wxplot/base.py

@@ -19,7 +19,10 @@ import os
 import sys
 
 import wx
-import wx.lib.plot as plot
+try:
+    import wx.lib.plot as plot
+except ImportError, e:
+    print >> sys.stderr, e
 
 from core.globalvar    import ETCICONDIR
 from core.settings     import UserSettings

+ 4 - 1
gui/wxpython/wxplot/histogram.py

@@ -18,7 +18,10 @@ This program is free software under the GNU General Public License
 import sys
 
 import wx
-import wx.lib.plot as plot
+try:
+    import wx.lib.plot as plot
+except ImportError, e:
+    print >> sys.stderr, e
 
 import grass.script as grass
 

+ 4 - 1
gui/wxpython/wxplot/profile.py

@@ -20,7 +20,10 @@ import sys
 import math
 
 import wx
-import wx.lib.plot as plot
+try:
+    import wx.lib.plot as plot
+except ImportError, e:
+    print >> sys.stderr, e
 
 import grass.script as grass
 from core.utils import _

+ 4 - 1
gui/wxpython/wxplot/scatter.py

@@ -18,7 +18,10 @@ This program is free software under the GNU General Public License
 import sys
 
 import wx
-import wx.lib.plot as plot
+try:
+    import wx.lib.plot as plot
+except ImportError, e:
+    print >> sys.stderr, e
 
 import grass.script as grass