def _set_rotation(self, value):
    self._check_camera_open()
    try:
        value = (((int(value) % 360) // 90) * 90)
    except ValueError:
        raise PiCameraValueError(('Invalid rotation angle: %s' % value))
    for port in self._camera.outputs:
        port.params[mmal.MMAL_PARAMETER_ROTATION] = value
def _set_rotation(self, value):
    self._check_camera_open()
    try:
        value = (((int(value) % 360) // 90) * 90)
    except ValueError:
        raise PiCameraValueError(('Invalid rotation angle: %s' % value))
    for port in self._camera.outputs:
        port.params[mmal.MMAL_PARAMETER_ROTATION] = value