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

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Oct 19 21:50:36 EDT 2011


Author: martinl
Date: 2011-10-19 18:50:36 -0700 (Wed, 19 Oct 2011)
New Revision: 48875

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py
Log:
wxGUI: fix parameter substitution (reset values)
       (merge r48874 from trunk)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py	2011-10-20 01:49:37 UTC (rev 48874)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py	2011-10-20 01:50:36 UTC (rev 48875)
@@ -497,8 +497,9 @@
             
             # get variable values
             varValue = dict()
-            for var in params['variables']['params']:
-                varValue[var['name']] = var['value']
+            if 'variables' in params:
+                for var in params['variables']['params']:
+                    varValue[var['name']] = var['value']
         
         log.cmdThread.SetId(-1)
         for item in self.GetItems():
@@ -558,8 +559,9 @@
         
         # discard values
         if params:
-            for var in params['variables']['params']:
-                var['value'] = ''
+            for item in params.itervalues():
+                for p in item['params']:
+                    p['value'] = ''
         
         if params:
             dlg.Destroy()
@@ -3180,7 +3182,7 @@
                                           (' ' * self.indent, f.get('name', '')))
             else: # parameter
                 for p in val:
-                    if not p.get('value', ''):
+                    if not p.get('value', '') and not p.get('parameterized', False):
                         continue
                     self.fd.write('%s<parameter name="%s">\n' %
                                   (' ' * self.indent, p.get('name', '')))



More information about the grass-commit mailing list