Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
  • Loading branch information
volayaf@gmail.com committed Mar 11, 2012
1 parent 9321752 commit 6cb5ddd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/sextante/parameters/ParameterNumber.py
Expand Up @@ -12,7 +12,14 @@ def __init__(self, name="", description="", minValue = None, maxValue = None, de

def setValue(self, n):
try:
self.value = float(n)
value = float(n)
if self.min:
if value < self.min:
return False
if self.max:
if value > self.max:
return False
self.value = value
return True
except:
return False
Expand Down

0 comments on commit 6cb5ddd

Please sign in to comment.