[GRASS-SVN] r49637 - in grass/branches/develbranch_6/gui/wxpython:
core lmgr mapdisp nviz vdigit
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Dec 9 06:57:59 EST 2011
Author: martinl
Date: 2011-12-09 03:57:59 -0800 (Fri, 09 Dec 2011)
New Revision: 49637
Modified:
grass/branches/develbranch_6/gui/wxpython/core/workspace.py
grass/branches/develbranch_6/gui/wxpython/lmgr/frame.py
grass/branches/develbranch_6/gui/wxpython/mapdisp/frame.py
grass/branches/develbranch_6/gui/wxpython/nviz/main.py
grass/branches/develbranch_6/gui/wxpython/vdigit/main.py
Log:
wxGUI: fix loading 3D view mode modules
(merge r49632 & r49636 from trunk)
Modified: grass/branches/develbranch_6/gui/wxpython/core/workspace.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/core/workspace.py 2011-12-09 11:17:54 UTC (rev 49636)
+++ grass/branches/develbranch_6/gui/wxpython/core/workspace.py 2011-12-09 11:57:59 UTC (rev 49637)
@@ -22,7 +22,7 @@
from core.utils import normalize_whitespace
from core.settings import UserSettings
-from nviz.workspace import NvizSettings
+from nviz.main import NvizSettings
class ProcessWorkspaceFile:
def __init__(self, tree):
@@ -55,9 +55,12 @@
self.displayIndex = -1 # first display has index '0'
self.__processFile()
+
+ if NvizSettings:
+ self.nvizDefault = NvizSettings()
+ else:
+ self.nvizDefault = None
- self.nvizDefault = NvizSettings()
-
def __filterValue(self, value):
"""!Filter value
Modified: grass/branches/develbranch_6/gui/wxpython/lmgr/frame.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/lmgr/frame.py 2011-12-09 11:17:54 UTC (rev 49636)
+++ grass/branches/develbranch_6/gui/wxpython/lmgr/frame.py 2011-12-09 11:57:59 UTC (rev 49637)
@@ -56,7 +56,6 @@
from gmodeler.model import Model
from gmodeler.frame import ModelFrame
from modules.vclean import VectorCleaningFrame
-from nviz.tools import NvizToolWindow
from psmap.frame import PsMapFrame
from core.debug import Debug
from gui_core.ghelp import MenuTreeWindow, AboutWindow
@@ -66,6 +65,7 @@
from lmgr.pyshell import PyShellWindow
from gui_core.forms import GUI
from gcp.manager import GCPWizard
+from nviz.main import haveNviz
class GMFrame(wx.Frame):
"""!Layer Manager frame with notebook widget for controlling GRASS
@@ -269,6 +269,11 @@
def AddNvizTools(self):
"""!Add nviz notebook page"""
Debug.msg(5, "GMFrame.AddNvizTools()")
+ if not haveNviz:
+ return
+
+ from nviz.main import NvizToolWindow
+
# show toolbar
self._auimgr.GetPane('toolbarNviz').Show()
# reorder other toolbars
Modified: grass/branches/develbranch_6/gui/wxpython/mapdisp/frame.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/mapdisp/frame.py 2011-12-09 11:17:54 UTC (rev 49636)
+++ grass/branches/develbranch_6/gui/wxpython/mapdisp/frame.py 2011-12-09 11:57:59 UTC (rev 49637)
@@ -49,8 +49,7 @@
from mapdisp.mapwindow import BufferedWindow
from modules.histogram import HistogramFrame
from wxplot.profile import ProfileFrame
-from nviz.main import haveNviz
-from nviz.mapwindow import GLWindow
+from nviz.main import haveNviz, GLWindow
from mapdisp import statusbar as sb
Modified: grass/branches/develbranch_6/gui/wxpython/nviz/main.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/nviz/main.py 2011-12-09 11:17:54 UTC (rev 49636)
+++ grass/branches/develbranch_6/gui/wxpython/nviz/main.py 2011-12-09 11:57:59 UTC (rev 49637)
@@ -20,18 +20,21 @@
errorMsg = ''
try:
- from wx import glcanvas
- import nviz.mapwindow
- import nviz.tools
+ from wx import glcanvas
+ from nviz import mapwindow
+ from nviz import tools
+ from nviz import workspace
import wxnviz
haveNviz = True
-except ImportError, err:
+except (ImportError, NameError), err:
haveNviz = False
errorMsg = err
if haveNviz:
- GLWindow = nviz.mapwindow.GLWindow
- NvizToolWindow = nviz.tools.NvizToolWindow
+ GLWindow = mapwindow.GLWindow
+ NvizToolWindow = tools.NvizToolWindow
+ NvizSettings = workspace.NvizSettings
else:
GLWindow = None
NvizToolWindow = None
+ NvizSettings = None
Modified: grass/branches/develbranch_6/gui/wxpython/vdigit/main.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/vdigit/main.py 2011-12-09 11:17:54 UTC (rev 49636)
+++ grass/branches/develbranch_6/gui/wxpython/vdigit/main.py 2011-12-09 11:57:59 UTC (rev 49637)
@@ -18,7 +18,7 @@
from vdigit.wxdigit import IVDigit, GV_LINES
haveVDigit = True
errorMsg = ''
-except ImportError, err:
+except (ImportError, NameError), err:
haveVDigit = False
errorMsg = err
GV_LINES = -1
More information about the grass-commit
mailing list