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

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Apr 1 05:38:35 PDT 2015


Author: zarch
Date: 2015-04-01 05:38:35 -0700 (Wed, 01 Apr 2015)
New Revision: 64971

Modified:
   grass/trunk/lib/python/pygrass/modules/interface/parameter.py
Log:
Fix undefined limits in the Parameter class

Modified: grass/trunk/lib/python/pygrass/modules/interface/parameter.py
===================================================================
--- grass/trunk/lib/python/pygrass/modules/interface/parameter.py	2015-04-01 11:23:17 UTC (rev 64970)
+++ grass/trunk/lib/python/pygrass/modules/interface/parameter.py	2015-04-01 12:38:35 UTC (rev 64971)
@@ -138,11 +138,12 @@
         if 'values' in diz:
             try:
                 # Check for integer ranges: "3-30" or float ranges: "0.0-1.0"
-                isrange = re.match("(?P<min>-*\d+.*\d*)-(?P<max>\d+.*\d*)",
+                isrange = re.match("(?P<min>-*\d+.*\d*)*-(?P<max>\d+.*\d*)*",
                                    diz['values'][0])
                 if isrange:
                     mn, mx = isrange.groups()
-                    self.min, self.max = float(mn), float(mx)
+                    self.min = None if mn is None else float(mn)
+                    self.max = None if mx is None else float(mx)
                     self.values = None
                     self.isrange = diz['values'][0]
                 # No range was found



More information about the grass-commit mailing list