[GRASS-SVN] r60177 - grass/branches/releasebranch_7_0/lib/python/pygrass/modules/interface
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun May 11 07:54:32 PDT 2014
Author: neteler
Date: 2014-05-11 07:54:32 -0700 (Sun, 11 May 2014)
New Revision: 60177
Modified:
grass/branches/releasebranch_7_0/lib/python/pygrass/modules/interface/parameter.py
Log:
Fix regexp to handle also negative range like in g.proj (datum_trans) (backport from trunk, r60176)
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 2014-05-11 12:24:42 UTC (rev 60176)
+++ grass/branches/releasebranch_7_0/lib/python/pygrass/modules/interface/parameter.py 2014-05-11 14:54:32 UTC (rev 60177)
@@ -38,7 +38,7 @@
if 'values' in diz:
try:
# Check for integer ranges: "3-30"
- isrange = re.match("(?P<min>\d+)-(?P<max>\d+)",
+ isrange = re.match("(?P<min>-*\d+)-(?P<max>\d+)",
diz['values'][0])
if isrange:
range_min, range_max = isrange.groups()
@@ -46,7 +46,7 @@
self.isrange = diz['values'][0]
# Check for float ranges: "0.0-1.0"
if not isrange:
- 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:
# We are not able to create range values from
More information about the grass-commit
mailing list