[GRASS-SVN] r65366 - grass/branches/releasebranch_7_0/lib/python/pygrass/modules/interface
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Jun 4 22:03:32 PDT 2015
Author: zarch
Date: 2015-06-04 22:03:32 -0700 (Thu, 04 Jun 2015)
New Revision: 65366
Modified:
grass/branches/releasebranch_7_0/lib/python/pygrass/modules/interface/parameter.py
Log:
pygrass: backport 64971, Fix undefined limits in the Parameter class
Modified: grass/branches/releasebranch_7_0/lib/python/pygrass/modules/interface/parameter.py
===================================================================
--- grass/branches/releasebranch_7_0/lib/python/pygrass/modules/interface/parameter.py 2015-06-04 21:32:21 UTC (rev 65365)
+++ grass/branches/releasebranch_7_0/lib/python/pygrass/modules/interface/parameter.py 2015-06-05 05:03:32 UTC (rev 65366)
@@ -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