[GRASS-SVN] r48990 - grass/branches/develbranch_6/lib/python

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Oct 29 13:05:03 EDT 2011


Author: martinl
Date: 2011-10-29 10:05:03 -0700 (Sat, 29 Oct 2011)
New Revision: 48990

Modified:
   grass/branches/develbranch_6/lib/python/task.py
Log:
pythonlib: fix `ignoreDefault` in task.get_cmd()
	   (merge r48989 from trunk)


Modified: grass/branches/develbranch_6/lib/python/task.py
===================================================================
--- grass/branches/develbranch_6/lib/python/task.py	2011-10-29 17:04:08 UTC (rev 48989)
+++ grass/branches/develbranch_6/lib/python/task.py	2011-10-29 17:05:03 UTC (rev 48990)
@@ -220,8 +220,9 @@
                     cmd +=  [ '%s=%s' % (p['name'], _('<required>')) ]
             elif p.get('value', '') ==  '' and p.get('default', '') != '' and not ignoreDefault:
                 cmd +=  [ '%s=%s' % (p['name'], p['default']) ]
-            elif p.get('value', '') !=  '' and p['value'] !=  p.get('default','') :
-                # Output only values that have been set, and different from defaults
+            elif p.get('value', '') !=  '' and \
+                    (p['value'] !=  p.get('default', '') or not ignoreDefault):
+                # output only values that have been set, and different from defaults
                 cmd +=  [ '%s=%s' % (p['name'], p['value']) ]
         
         errList = self.get_cmd_error()



More information about the grass-commit mailing list