def _set_preview_layer(self, value):
    self._check_camera_open()
    warnings.warn(PiCameraDeprecated('PiCamera.preview_layer is deprecated; use PiCamera.preview.layer instead'))
    if self.preview:
        self.preview.layer = value
    else:
        self._preview_layer = value
def _set_preview_layer(self, value):
    self._check_camera_open()
    warnings.warn(PiCameraDeprecated('PiCamera.preview_layer is deprecated; use PiCamera.preview.layer instead'))
    if self.preview:
        self.preview.layer = value
    else:
        self._preview_layer = value