[GRASS-SVN] r56351 - grass/trunk/lib/python/script

svn_grass at osgeo.org svn_grass at osgeo.org
Tue May 21 08:25:31 PDT 2013


Author: annakrat
Date: 2013-05-21 08:25:30 -0700 (Tue, 21 May 2013)
New Revision: 56351

Modified:
   grass/trunk/lib/python/script/task.py
Log:
pythonlib/task: include quotes when spaces are in parameter

Modified: grass/trunk/lib/python/script/task.py
===================================================================
--- grass/trunk/lib/python/script/task.py	2013-05-21 15:24:16 UTC (rev 56350)
+++ grass/trunk/lib/python/script/task.py	2013-05-21 15:25:30 UTC (rev 56351)
@@ -234,7 +234,10 @@
             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']) ]
+                if ' ' in p['value']:
+                    cmd +=  [ '%s="%s"' % (p['name'], p['value']) ]
+                else:
+                    cmd +=  [ '%s=%s' % (p['name'], p['value']) ]
         
         errList = self.get_cmd_error()
         if ignoreErrors is False and errList:



More information about the grass-commit mailing list