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

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Nov 19 02:39:01 PST 2012


Author: zarch
Date: 2012-11-19 02:39:01 -0800 (Mon, 19 Nov 2012)
New Revision: 53907

Modified:
   grass/trunk/lib/python/pygrass/modules/__init__.py
Log:
Fix default value in Parameter class and rephrase the string error

Modified: grass/trunk/lib/python/pygrass/modules/__init__.py
===================================================================
--- grass/trunk/lib/python/pygrass/modules/__init__.py	2012-11-19 10:20:54 UTC (rev 53906)
+++ grass/trunk/lib/python/pygrass/modules/__init__.py	2012-11-19 10:39:01 UTC (rev 53907)
@@ -149,6 +149,8 @@
             i) for i in diz['values']] if 'values' in diz else None
         self.default = self._type(
             diz['default']) if 'default' in diz else None
+        if self.default is not None:
+            self._value = self.default
         self.guisection = diz.get('guisection', None)
         if 'gisprompt' in diz:
             self.type = diz['gisprompt']['prompt']
@@ -166,7 +168,7 @@
                 self._value = [
                     val for val in value if isinstance(value, self._type)]
             else:
-                str_err = 'The Parameter <%s>, not support multiple inputs'
+                str_err = 'The Parameter <%s> does not accept multiple inputs'
                 raise TypeError(str_err % self.name)
         elif isinstance(value, self._type):
             if self.values:



More information about the grass-commit mailing list