File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,15 +49,20 @@ def get_rotation(rotation):
4949
5050 *rotation* may be 'horizontal', 'vertical', or a numeric value in degrees.
5151 """
52- if rotation in ('horizontal' , None ):
53- angle = 0.
54- elif rotation == 'vertical' :
55- angle = 90.
56- else :
52+ try :
5753 angle = float (rotation )
58- return angle % 360
59-
54+ except (ValueError , TypeError ):
55+ isString = isinstance (rotation , six .string_types )
56+ if ((isString and rotation == 'horizontal' ) or rotation is None ):
57+ angle = 0.
58+ elif (isString and rotation == 'vertical' ):
59+ angle = 90.
60+ else :
61+ raise ValueError ("rotation is {0} expected either 'horizontal'"
62+ " 'vertical', numeric value or"
63+ "None" .format (rotation ))
6064
65+ return angle
6166# these are not available for the object inspector until after the
6267# class is build so we define an initial set here for the init
6368# function and they will be overridden after object defn
You can’t perform that action at this time.
0 commit comments