[GRASS-SVN] r32324 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Jul 26 18:53:52 EDT 2008
Author: martinl
Date: 2008-07-26 18:53:52 -0400 (Sat, 26 Jul 2008)
New Revision: 32324
Modified:
grass/trunk/gui/wxpython/gui_modules/nviz.py
grass/trunk/gui/wxpython/gui_modules/workspace.py
Log:
nviz2/wxGUI: minor workspace-related fixes
Modified: grass/trunk/gui/wxpython/gui_modules/nviz.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/nviz.py 2008-07-26 22:52:19 UTC (rev 32323)
+++ grass/trunk/gui/wxpython/gui_modules/nviz.py 2008-07-26 22:53:52 UTC (rev 32324)
@@ -2554,7 +2554,11 @@
self.UpdateVectorShow(vecType, checked)
if checked:
- id = data[vecType]['object']['id']
+ try:
+ id = data[vecType]['object']['id']
+ except KeyError:
+ return
+
self.mapWindow.SetLayerData(item, id, vecType)
# update properties
Modified: grass/trunk/gui/wxpython/gui_modules/workspace.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/workspace.py 2008-07-26 22:52:19 UTC (rev 32323)
+++ grass/trunk/gui/wxpython/gui_modules/workspace.py 2008-07-26 22:53:52 UTC (rev 32324)
@@ -422,6 +422,9 @@
@param data Nviz layer properties
"""
+ if not data.has_key('object'): # skip disabled
+ return
+
self.indent += 4
for attrb in data.iterkeys():
if len(data[attrb]) < 1: # skip empty attributes
@@ -485,7 +488,7 @@
self.indent -= 4
def __writeNvizVector(self, data):
- """Save Nviz vector layer properties to workspace
+ """Save Nviz vector layer properties (lines/points) to workspace
@param data Nviz layer properties
"""
@@ -493,16 +496,22 @@
for attrb in data.iterkeys():
if len(data[attrb]) < 1: # skip empty attributes
continue
+
+ if not data[attrb].has_key('object'): # skip disabled
+ continue
+
self.file.write('%s<%s>\n' % (' ' * self.indent, attrb))
self.indent += 4
for name in data[attrb].iterkeys():
+ if name == 'object':
+ continue
if name == 'mode':
self.file.write('%s<%s type="%s">\n' % (' ' * self.indent, name,
data[attrb][name]['type']))
if data[attrb][name]['type'] == 'surface':
self.indent += 4
self.file.write('%s<map>%s</map>\n' % (' ' * self.indent,
- data[attrb][name]['map']))
+ data[attrb][name]['surface']))
self.indent -= 4
self.file.write('%s</%s>\n' % ((' ' * self.indent, name)))
else:
More information about the grass-commit
mailing list