Skip to content

Commit 6cb5ddd

Browse files
author
volayaf@gmail.com
committed
Added value range control to ParameterNumber
git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@36 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
1 parent 9321752 commit 6cb5ddd

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/sextante/parameters/ParameterNumber.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,14 @@ def __init__(self, name="", description="", minValue = None, maxValue = None, de
1212

1313
def setValue(self, n):
1414
try:
15-
self.value = float(n)
15+
value = float(n)
16+
if self.min:
17+
if value < self.min:
18+
return False
19+
if self.max:
20+
if value > self.max:
21+
return False
22+
self.value = value
1623
return True
1724
except:
1825
return False

0 commit comments

Comments
 (0)