#NEWLINE# def validate( self , value ) : #NEWLINE# #INDENT# ': Validate and return a valid value\n\n      = ERROR CONDITIONS\n      - Will throw an exception if the specified value is invalid.\n\n      = INPUT VARIABLES\n      - value   The value to set the instance of this property to.\n\n      = RETURN VALUE\n      - Returns a valid value.\n      ' #NEWLINE# result = StyleProperty . validate ( self , value ) #NEWLINE# if ( result is None ) : #NEWLINE# #INDENT# return result #NEWLINE# #UNINDENT# msg = '' #NEWLINE# if ( self . min is not None ) : #NEWLINE# #INDENT# if ( result < self . min ) : #NEWLINE# #INDENT# msg += ( 'Value must be greater than %s\n' % ( self . min , ) ) #NEWLINE# #UNINDENT# #UNINDENT# if ( self . max is not None ) : #NEWLINE# #INDENT# if ( result > self . max ) : #NEWLINE# #INDENT# msg += ( 'Value must be less than %s\n' % ( self . max , ) ) #NEWLINE# #UNINDENT# #UNINDENT# if msg : #NEWLINE# #INDENT# msg = ( "Error converting the '%s' value.\n%sValue = %s" % ( self . name , msg , value ) ) #NEWLINE# raise Exception ( msg ) #NEWLINE# #UNINDENT# return result