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

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Jul 28 14:23:24 EDT 2010


Author: martinl
Date: 2010-07-28 18:23:24 +0000 (Wed, 28 Jul 2010)
New Revision: 42925

Modified:
   grass/trunk/gui/wxpython/gui_modules/nviz.py
   grass/trunk/gui/wxpython/gui_modules/toolbars.py
   grass/trunk/gui/wxpython/gui_modules/workspace.py
   grass/trunk/gui/wxpython/gui_modules/wxnviz.py
Log:
wxGUI/nviz: various minor fixes


Modified: grass/trunk/gui/wxpython/gui_modules/nviz.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/nviz.py	2010-07-28 17:50:18 UTC (rev 42924)
+++ grass/trunk/gui/wxpython/gui_modules/nviz.py	2010-07-28 18:23:24 UTC (rev 42925)
@@ -28,6 +28,7 @@
     from wx import glcanvas
     import nviz_mapdisp
     import nviz_tools
+    import wxnviz
     haveNviz = True
 except ImportError, err:
     haveNviz = False

Modified: grass/trunk/gui/wxpython/gui_modules/toolbars.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/toolbars.py	2010-07-28 17:50:18 UTC (rev 42924)
+++ grass/trunk/gui/wxpython/gui_modules/toolbars.py	2010-07-28 18:23:24 UTC (rev 42925)
@@ -189,6 +189,8 @@
             from wxnviz import errorMsg as errorMsg2
             if errorMsg2:
                 errorMsg = str(errorMsg1) + ' (' + str(errorMsg2) + ')'
+            else:
+                errorMsg = str(errorMsg1)
             log.WriteCmdLog(_('3D view mode not available'))
             log.WriteWarning(_('Reason: %s') % errorMsg)
             log.WriteLog(_('Note that the 3D view mode is currently not working under MS Windows '

Modified: grass/trunk/gui/wxpython/gui_modules/workspace.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/workspace.py	2010-07-28 17:50:18 UTC (rev 42924)
+++ grass/trunk/gui/wxpython/gui_modules/workspace.py	2010-07-28 18:23:24 UTC (rev 42925)
@@ -38,7 +38,6 @@
 
 #sys.path.append(os.path.join(globalvar.ETCWXDIR, "nviz"))
 try:
-    #import grass7_wxnviz as wxnviz
     import wxnviz
 except ImportError:
     wxnviz = None
@@ -456,11 +455,11 @@
 
             data['draw'][control] = { 'value' : value }
             data['draw'][control]['update'] = None
-            
+        
         value, desc = self.GetDrawMode(UserSettings.Get(group='nviz', key='surface', subkey=['draw', 'mode']),
                                        UserSettings.Get(group='nviz', key='surface', subkey=['draw', 'style']),
                                        UserSettings.Get(group='nviz', key='surface', subkey=['draw', 'shading']))
-
+    
         data['draw']['mode'] = { 'value' : value,
                                  'desc' : desc, 
                                  'update': None }

Modified: grass/trunk/gui/wxpython/gui_modules/wxnviz.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/wxnviz.py	2010-07-28 17:50:18 UTC (rev 42924)
+++ grass/trunk/gui/wxpython/gui_modules/wxnviz.py	2010-07-28 18:23:24 UTC (rev 42925)
@@ -487,8 +487,11 @@
         Debug.msg(3, "Nviz::SetSurfaceAttr(): id=%d, attr=%d, map=%d, value=%s",
                   id, attr, map, value)
         
-        return 1 if ret else -2
-
+        if ret < 0:
+            return -2
+        
+        return 1
+    
     def UnsetSurfaceMask(self, id):
         """!Unset surface mask
         
@@ -541,7 +544,10 @@
         
         ret = Nviz_unset_attr(id, MAP_OBJ_SURF, attr)
         
-        return 1 if ret else -2
+        if ret < 0:
+            return -2
+        
+        return 1
 
     def SetSurfaceRes(self, id, fine, coarse):
         """!Set surface resolution
@@ -852,7 +858,10 @@
         
         ret = GVL_isosurf_del(id, isosurf_id)
         
-        return -3 if ret < 0 else 1
+        if ret < 0:
+            return -3
+
+        return 1
     
     def MoveIsosurface(self, id, isosurf_id, up):
         """!Move isosurface up/down in the list
@@ -877,8 +886,11 @@
         else:
             ret = GVL_isosurf_move_down(id, isosurf_id)
         
-        return -3 if ret < 0 else 1
+        if ret < 0:
+            return -3
 
+        return 1
+
     def SetIsosurfaceColor(self, id, isosurf_id, map, value):
         """!Set isosurface color
         
@@ -990,7 +1002,10 @@
                   "attr=%d, map=%d, value=%s",
                   id, isosurf_id, attr, map, value)
         
-        return 1 if ret > 0 else -2
+        if ret < 0:
+            return -2
+        
+        return 1
     
     def UnsetIsosurfaceMask(self, id, isosurf_id):
         """!Unset isosurface mask
@@ -1054,7 +1069,10 @@
         
         ret = GVL_isosurf_unset_att(id, isosurf_id, attr)
         
-        return 1 if ret > 0 else -2
+        if ret < 0:
+            return -2
+        
+        return 1
 
     def SetIsosurfaceMode(self, id, mode):
         """!Set draw mode for isosurfaces
@@ -1070,7 +1088,10 @@
         
         ret = GVL_isosurf_set_drawmode(id, mode)
         
-        return -2 if ret < 0 else 1
+        if ret < 0:
+            return -2
+        
+        return 1
     
     def SetIsosurfaceRes(self, id, res):
         """!Set draw resolution for isosurfaces
@@ -1086,7 +1107,10 @@
         
         ret = GVL_isosurf_set_drawres(id, res, res, res)
         
-        return -2 if ret < 0 else 1
+        if ret < 0:
+            return -2
+        
+        return 1
 
     def SaveToFile(self, filename, width = 20, height = 20, itype = 'ppm'):
         """!Save current GL screen to ppm/tif file



More information about the grass-commit mailing list