[GRASS-SVN] r43005 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Aug 4 16:09:27 EDT 2010


Author: martinl
Date: 2010-08-04 20:09:27 +0000 (Wed, 04 Aug 2010)
New Revision: 43005

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/workspace.py
Log:
wxGUI/nviz: some workspace-related fixes
(merge r43004 from trunk)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/workspace.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/workspace.py	2010-08-04 20:07:10 UTC (rev 43004)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/workspace.py	2010-08-04 20:09:27 UTC (rev 43005)
@@ -345,17 +345,14 @@
                 marker = str(node_vpoints.get('marker', ''))
                 markerId = list(UserSettings.Get(group='nviz', key='vector',
                                                  subkey=['points', 'marker'], internal=True)).index(marker)
-                nviz['vector']['points']['marker'] = markerId
+                nviz['vector']['points']['marker'] = { 'value' : markerId }
                 
                 node_mode = node_vpoints.find('mode')
                 if node_mode is not None:
                     nviz['vector']['points']['mode'] = {}
                     nviz['vector']['points']['mode']['type'] = str(node_mode.get('type', ''))
-                    nviz['vector']['points']['mode']['surface'] = ''
-                    
-                    # map
                     nviz['vector']['points']['mode']['surface'] = \
-                        self.__processLayerNvizNode(node_vpoints, 'map', str)
+                        self.__processLayerNvizNode(node_mode, 'map', str)
                 
                 # color
                 self.__processLayerNvizNode(node_vpoints, 'color', str,
@@ -404,7 +401,16 @@
         """!Process given tag nviz/vector"""
         node_tag = node.find(tag)
         if node_tag is not None:
-            value = cast(self.__getNodeText(node_tag, 'value'))
+            if node_tag.find('value') is not None:
+                value = cast(self.__getNodeText(node_tag, 'value'))
+            else:
+                try:
+                    value = cast(node_tag.text)
+                except ValueError:
+                    if cast == str:
+                        value = ''
+                    else:
+                        value = None
             if dc:
                 dc[tag] = dict()
                 dc[tag]['value'] = value
@@ -916,9 +922,9 @@
             if attrb == 'lines':
                 self.file.write('%s<v%s>\n' % (' ' * self.indent, attrb))
             elif attrb == 'points':
-                markerId = data[attrb]['marker']
-                marker = UserSettings.Get(group='nviz', key='vector',
-                                          subkey=['points', 'marker'], internal=True)[markerId]
+                markerId = data[attrb]['marker']['value']
+                marker = UserSettings.Get(group = 'nviz', key = 'vector',
+                                          subkey = ['points', 'marker'], internal = True)[markerId]
                 self.file.write('%s<v%s marker="%s">\n' % (' ' * self.indent,
                                                            attrb,
                                                            marker))



More information about the grass-commit mailing list