From f9eaf6ef4c3112f3768a6b8454ee15bca4ad31d3 Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Wed, 10 Oct 2012 01:04:19 +0200 Subject: [PATCH] typo --- kivy/properties.pyx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/kivy/properties.pyx b/kivy/properties.pyx index 65de8540c..9d3474ba4 100644 --- a/kivy/properties.pyx +++ b/kivy/properties.pyx @@ -88,20 +88,19 @@ Error Handling If setting a value would otherwise raise a ValueError, you have two options to handle the error gracefully within the property. An errorvalue is a substitute -for the invalid value. An errorhandler is a callable (single argument function -or lambda) which can return a valid substitute:: - +for the invalid value. An errorhandler is a callable (single argument function +or lambda) which can return a valid substitute. errorhandler parameter:: + # simply returns 0 if the value exceeds the bounds bnp = BoundedNumericProperty(0, min=-500, max=500, errorvalue=0) - errorvalue parameter:: - # returns a the boundary value when exceeded - bnp = BoundedNumericProperty(0, min=-500, max=500, - errorhandler=lambda x: 500 if x > 500 else -500) + # returns a the boundary value when exceeded + bnp = BoundedNumericProperty(0, min=-500, max=500, + errorhandler=lambda x: 500 if x > 500 else -500) Conclusion @@ -314,7 +313,7 @@ cdef class Property: return False try: - self.check(obj, value) + self.check(obj, value) except ValueError as e: errorvalue = obj.__storage[self._name]['errorvalue'] errorhandler = obj.__storage[self._name]['errorhandler']