0

don't complain if crop values go from high-low, just swap them

This commit is contained in:
Andrew Brown
2012-03-01 22:05:17 -05:00
parent 344639c0cf
commit 0d229a3888

View File

@@ -90,9 +90,6 @@ def validateNorthDirection(direction):
raise ValidationException("%r is not a valid north direction" % direction) raise ValidationException("%r is not a valid north direction" % direction)
return intdir return intdir
def validateRenderRange(r):
raise NotImplementedError("render range")
def validateStochastic(s): def validateStochastic(s):
val = float(s) val = float(s)
if val < 0 or val > 1: if val < 0 or val > 1:
@@ -171,9 +168,9 @@ def validateCrop(value):
raise ValidationException("The value for the 'crop' setting must be a tuple of length 4") raise ValidationException("The value for the 'crop' setting must be a tuple of length 4")
value = tuple(int(x) for x in value) value = tuple(int(x) for x in value)
if value[0] >= value[2]: if value[0] >= value[2]:
raise ValidationException("About your crop numbers, the xmax value must be greater than the xmin value") value[0],value[2] = value[2],value[0]
if value[1] >= value[3]: if value[1] >= value[3]:
raise ValidationException("About your crop numbers, the zmax value must be greater than the zmin value") value[1],value[3] = value[3],value[1]
return value return value
def make_dictValidator(keyvalidator, valuevalidator): def make_dictValidator(keyvalidator, valuevalidator):