def range_error_message(error_message, what_to_enter, minimum, maximum):
 if (error_message is None):
  error_message = ('Enter ' + what_to_enter)
  if ((minimum is not None) and (maximum is not None)):
   error_message += ' between %(min)g and %(max)g'
  elif (minimum is not None):
   error_message += ' greater than or equal to %(min)g'
  elif (maximum is not None):
   error_message += ' less than or equal to %(max)g'
 if (type(maximum) in [int, long]):
  maximum -= 1
 return (translate(error_message) % dict(min=minimum, max=maximum))

def range_error_message ( error_message , what_to_enter , minimum , maximum ) : if ( error_message is None ) : error_message = ( 'Enter ' + what_to_enter ) if ( ( minimum is not None ) and ( maximum is not None ) ) : error_message += ' between %(min)g and %(max)g' elif ( minimum is not None ) : error_message += ' greater than or equal to %(min)g' elif ( maximum is not None ) : error_message += ' less than or equal to %(max)g' if ( type ( maximum ) in [ int , long ] ) : maximum -= 1 return ( translate ( error_message ) % dict ( min = minimum , max = maximum ) )
build the error message for the number range validators .