details: http://www.bx.psu.edu/hg/galaxy/rev/82082fd1da62 changeset: 3250:82082fd1da62 user: Dan Blankenberg <dan@bx.psu.edu> date: Tue Jan 19 14:22:31 2010 -0500 description: c.log diffstat: lib/galaxy/tools/parameters/validation.py | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diffs (26 lines): diff -r 85d032d94db1 -r 82082fd1da62 lib/galaxy/tools/parameters/validation.py --- a/lib/galaxy/tools/parameters/validation.py Tue Jan 19 13:41:53 2010 -0500 +++ b/lib/galaxy/tools/parameters/validation.py Tue Jan 19 14:22:31 2010 -0500 @@ -105,18 +105,18 @@ """ @classmethod def from_element( cls, param, elem ): - return cls( elem.get( 'message', None ), elem.get( 'min' ), elem.get( 'max' ) ) + return cls( elem.get( 'message', None ), elem.get( 'min', '-inf' ), elem.get( 'max', '+inf' ) ) def __init__( self, message, range_min, range_max ): - self.message = message or ( "Value must be between %f and %f" % ( range_min, range_max ) ) self.min = float( range_min ) - self.max = float( range_max ) + self.max = float( range_max ) + self.message = message or ( "Value must be between %f and %f" % ( self.min, self.max ) ) def validate( self, value, history=None ): if not( self.min <= float( value ) <= self.max ): raise ValueError( self.message ) class LengthValidator( Validator ): """ - Validator that ensures a number is in a specific range + Validator that ensures the length of the provided string (value) is in a specific range >>> from galaxy.tools.parameters import ToolParameter >>> p = ToolParameter.build( None, XML( '''