diff --git a/tilecloud_chain/generate.py b/tilecloud_chain/generate.py index f87656c61..649026d86 100644 --- a/tilecloud_chain/generate.py +++ b/tilecloud_chain/generate.py @@ -543,6 +543,12 @@ def __call__(self, config_file: str, layer_name: str) -> TileStore | None: ) return None + def __str__(self) -> str: + return self.__class__.__name__ + + def __repr__(self) -> str: + return self.__str__() + def detach() -> None: """Detach to the parent process.""" diff --git a/tilecloud_chain/multitilestore.py b/tilecloud_chain/multitilestore.py index 1f6cc1fb1..cef73bc61 100644 --- a/tilecloud_chain/multitilestore.py +++ b/tilecloud_chain/multitilestore.py @@ -116,13 +116,15 @@ def apply(key: tuple[str, str], tiles: Iterator[Tile]) -> Iterator[Tile]: def __str__(self) -> str: """Return a string representation of the object.""" - stores = {str(store) for store in self.stores.values() if store is not None} - return f"{self.__class__.__name__}({', '.join(stores)})" + stores = {str(store) for store in self.stores.values()} + keys = {f"{config_file}/{layer}" for config_file, layer in self.stores} + return f"{self.__class__.__name__}({', '.join(stores)} - {', '.join(keys)})" def __repr__(self) -> str: """Return a string representation of the object.""" - stores = {repr(store) for store in self.stores.values() if store is not None} - return f"{self.__class__.__name__}({', '.join(stores)})" + stores = {repr(store) for store in self.stores.values()} + keys = {f"{config_file}/{layer}" for config_file, layer in self.stores} + return f"{self.__class__.__name__}({', '.join(stores)} - {', '.join(keys)})" @staticmethod def _get_layer(tile: Tile | None) -> tuple[str, str]: diff --git a/tilecloud_chain/timedtilestore.py b/tilecloud_chain/timedtilestore.py index 699c93578..47ccba2c4 100644 --- a/tilecloud_chain/timedtilestore.py +++ b/tilecloud_chain/timedtilestore.py @@ -121,8 +121,8 @@ def get_cheap_bounding_pyramid(self) -> BoundingPyramid | None: def __str__(self) -> str: """Get string representation.""" - return f"{self.__class__.__name__}({self._tile_store}" + return f"{self.__class__.__name__}({self._store_name}: {self._tile_store}" def __repr__(self) -> str: """Get string representation.""" - return f"{self.__class__.__name__}({self._tile_store!r})" + return f"{self.__class__.__name__}({self._store_name}: {self._tile_store!r})"