From f7977059140dd54310ff83a810640609d8e0bb54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Wed, 18 Dec 2024 14:09:07 +0100 Subject: [PATCH] Add TimedTileStore representation --- tilecloud_chain/multitilestore.py | 5 +++-- tilecloud_chain/timedtilestore.py | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tilecloud_chain/multitilestore.py b/tilecloud_chain/multitilestore.py index 95988806e..1f6cc1fb1 100644 --- a/tilecloud_chain/multitilestore.py +++ b/tilecloud_chain/multitilestore.py @@ -116,12 +116,13 @@ def apply(key: tuple[str, str], tiles: Iterator[Tile]) -> Iterator[Tile]: def __str__(self) -> str: """Return a string representation of the object.""" - stores = {store.__class__.__name__ for store in self.stores.values() if store is not None} + stores = {str(store) for store in self.stores.values() if store is not None} return f"{self.__class__.__name__}({', '.join(stores)})" def __repr__(self) -> str: """Return a string representation of the object.""" - return str(self) + stores = {repr(store) for store in self.stores.values() if store is not None} + return f"{self.__class__.__name__}({', '.join(stores)})" @staticmethod def _get_layer(tile: Tile | None) -> tuple[str, str]: diff --git a/tilecloud_chain/timedtilestore.py b/tilecloud_chain/timedtilestore.py index e2acb90d5..699c93578 100644 --- a/tilecloud_chain/timedtilestore.py +++ b/tilecloud_chain/timedtilestore.py @@ -121,4 +121,8 @@ def get_cheap_bounding_pyramid(self) -> BoundingPyramid | None: def __str__(self) -> str: """Get string representation.""" - return f"tilecloud_chain.timedtilestore.TimedTileStoreWrapper: {self._tile_store}" + return f"{self.__class__.__name__}({self._tile_store}" + + def __repr__(self) -> str: + """Get string representation.""" + return f"{self.__class__.__name__}({self._tile_store!r})"