[GRASS-SVN] r56813 - grass/trunk/lib/python/pygrass/modules/interface

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jun 20 01:37:31 PDT 2013


Author: zarch
Date: 2013-06-20 01:37:30 -0700 (Thu, 20 Jun 2013)
New Revision: 56813

Modified:
   grass/trunk/lib/python/pygrass/modules/interface/parameter.py
Log:
Fix to manage parameters that are not multiple but are more than one, like range in i.atcorr

Modified: grass/trunk/lib/python/pygrass/modules/interface/parameter.py
===================================================================
--- grass/trunk/lib/python/pygrass/modules/interface/parameter.py	2013-06-20 08:16:30 UTC (rev 56812)
+++ grass/trunk/lib/python/pygrass/modules/interface/parameter.py	2013-06-20 08:37:30 UTC (rev 56813)
@@ -55,10 +55,15 @@
         #
         # default
         #
-        self.default = self._type(
-            diz['default']) if 'default' in diz else None
-        if self.default is not None:
+        if 'default' in diz:
+            if self.multiple or self.keydescvalues:
+                self.default = [self._type(v)
+                                for v in diz['default'].split(',')]
+            else:
+                self.default = self._type(diz['default'])
             self._value = self.default
+        else:
+            self.default = None
 
         self.guisection = diz.get('guisection', None)
 



More information about the grass-commit mailing list