Bladeren bron

wxGUI: attempt to fix https://trac.osgeo.org/grass/ticket/1563 (wxGUI will not start)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@50671 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 13 jaren geleden
bovenliggende
commit
4a84e2ee5c
3 gewijzigde bestanden met toevoegingen van 16 en 10 verwijderingen
  1. 7 4
      gui/wxpython/nviz/wxnviz.py
  2. 1 1
      gui/wxpython/vdigit/main.py
  3. 8 5
      gui/wxpython/vdigit/wxdisplay.py

+ 7 - 4
gui/wxpython/nviz/wxnviz.py

@@ -75,10 +75,13 @@ def print_progress(value):
     
     return 0
 
-errtype = CFUNCTYPE(UNCHECKED(c_int), String, c_int)
-errfunc = errtype(print_error)
-pertype = CFUNCTYPE(UNCHECKED(c_int), c_int)
-perfunc = pertype(print_progress)
+try:
+    errtype = CFUNCTYPE(UNCHECKED(c_int), String, c_int)
+    errfunc = errtype(print_error)
+    pertype = CFUNCTYPE(UNCHECKED(c_int), c_int)
+    perfunc = pertype(print_progress)
+except NameError:
+    pass
 
 class Nviz(object):
     def __init__(self, glog, gprogress):

+ 1 - 1
gui/wxpython/vdigit/main.py

@@ -15,7 +15,7 @@ This program is free software under the GNU General Public License
 """
 
 try:
-    from vdigit.wxdigit import IVDigit, GV_LINES
+    from vdigit.wxdigit import IVDigit, GV_LINES, CFUNCTYPE
     haveVDigit = True
     errorMsg   = ''
 except (ImportError, NameError), err:

+ 8 - 5
gui/wxpython/vdigit/wxdisplay.py

@@ -67,11 +67,14 @@ def GetLastError():
     
     return ret
 
-errtype = CFUNCTYPE(UNCHECKED(c_int), String, c_int)
-errfunc = errtype(print_error)
-pertype = CFUNCTYPE(UNCHECKED(c_int), c_int)
-perfunc = pertype(print_progress)
-
+try:
+    errtype = CFUNCTYPE(UNCHECKED(c_int), String, c_int)
+    errfunc = errtype(print_error)
+    pertype = CFUNCTYPE(UNCHECKED(c_int), c_int)
+    perfunc = pertype(print_progress)
+except NameError:
+    pass
+    
 class DisplayDriver:
     def __init__(self, device, deviceTmp, mapObj, window, glog, gprogress):
         """!Display driver used by vector digitizer