[GRASS-SVN] r61676 - grass/branches/releasebranch_7_0/gui/wxpython/core
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Aug 18 08:30:58 PDT 2014
Author: wenzeslaus
Date: 2014-08-18 08:30:57 -0700 (Mon, 18 Aug 2014)
New Revision: 61676
Modified:
grass/branches/releasebranch_7_0/gui/wxpython/core/workspace.py
Log:
do not parse task node for command layer to fix saving command layer to workspace (backport r61279)
Modified: grass/branches/releasebranch_7_0/gui/wxpython/core/workspace.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/core/workspace.py 2014-08-18 14:25:39 UTC (rev 61675)
+++ grass/branches/releasebranch_7_0/gui/wxpython/core/workspace.py 2014-08-18 15:30:57 UTC (rev 61676)
@@ -214,21 +214,28 @@
# layer attributes (task) - 2D settings
#
node_task = layer.find('task')
- cmd.append(node_task.get('name', "unknown"))
-
- # flags
- for p in node_task.findall('flag'):
- flag = p.get('name', '')
- if len(flag) > 1:
- cmd.append('--' + flag)
- else:
- cmd.append('-' + flag)
-
- # parameters
- for p in node_task.findall('parameter'):
- cmd.append('%s=%s' % (p.get('name', ''),
- self.__filterValue(self.__getNodeText(p, 'value'))))
-
+ if node_task is None and layer.get('type') == 'command':
+ # TODO: perhaps the XML format should be changed and command
+ # should be changed to contain task
+ # TODO: where the command layer gets actually processed?
+ pass
+ else:
+ cmd.append(node_task.get('name', "unknown"))
+
+ # flags
+ for p in node_task.findall('flag'):
+ flag = p.get('name', '')
+ if len(flag) > 1:
+ cmd.append('--' + flag)
+ else:
+ cmd.append('-' + flag)
+
+ # parameters
+ for p in node_task.findall('parameter'):
+ cmd.append('%s=%s' % (p.get('name', ''),
+ self.__filterValue(
+ self.__getNodeText(p, 'value'))))
+
if layer.find('selected') is not None:
selected = True
else:
More information about the grass-commit
mailing list