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

svn_grass at osgeo.org svn_grass at osgeo.org
Sun May 11 05:24:42 PDT 2014


Author: zarch
Date: 2014-05-11 05:24:42 -0700 (Sun, 11 May 2014)
New Revision: 60176

Modified:
   grass/trunk/lib/python/pygrass/modules/interface/parameter.py
Log:
Fix regexp to handle also negative range like in g.proj (datum_trans).

Modified: grass/trunk/lib/python/pygrass/modules/interface/parameter.py
===================================================================
--- grass/trunk/lib/python/pygrass/modules/interface/parameter.py	2014-05-11 11:51:45 UTC (rev 60175)
+++ grass/trunk/lib/python/pygrass/modules/interface/parameter.py	2014-05-11 12:24:42 UTC (rev 60176)
@@ -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