Skip to content

Commit

Permalink
chores: display deprecation warning when calling prune_images because…
Browse files Browse the repository at this point in the history
… it is no longer required
  • Loading branch information
denniswittich committed Sep 19, 2024
1 parent 9277b14 commit 11675df
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rosys/vision/camera_provider.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import abc
import warnings
from typing import Generic, TypeVar

from .. import persistence, rosys
Expand Down Expand Up @@ -57,7 +58,7 @@ def add_camera(self, camera: T) -> None:
self.request_backup()

def remove_camera(self, camera_id: str) -> None:
del self.cameras[camera_id]
del self._cameras[camera_id]
self.CAMERA_REMOVED.emit(camera_id)
self.request_backup()

Expand All @@ -66,6 +67,7 @@ def remove_all_cameras(self) -> None:
self.remove_camera(camera_id)

def prune_images(self, max_age_seconds: float | None = None):
warnings.warn('Pruning images is not required anymore because images is now a deque')
for camera in self.cameras.values():
if max_age_seconds is None:
camera.images.clear()
Expand Down

0 comments on commit 11675df

Please sign in to comment.