From 207514c2e8ed05bfc4d84bf867a0e063b41dd629 Mon Sep 17 00:00:00 2001 From: ClaireHzl <126695207+ClaireHzl@users.noreply.github.com> Date: Wed, 22 Jan 2025 14:35:47 +0100 Subject: [PATCH] Modify print function. --- src/reachy2_sdk/reachy_sdk.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/reachy2_sdk/reachy_sdk.py b/src/reachy2_sdk/reachy_sdk.py index d5dd08c6..6e3670b2 100644 --- a/src/reachy2_sdk/reachy_sdk.py +++ b/src/reachy2_sdk/reachy_sdk.py @@ -462,15 +462,16 @@ def _confirm_connection(self) -> bool: def _print_mode_type(self) -> None: """Print a warning for users, on the mode of Reachy.""" + # check if the last executing instance is the current one to avoid printing warning on a different instance + if ReachySDK._last_executing_instance != self: + return + if self._grpc_connected: mode = self._mode if mode == "REAL": warning_str = "\n ⚠️ Be careful, you're controlling the PHYSICAL Reachy" else: warning_str = " you're controlling the virtual Reachy" - - if ReachySDK._last_executing_instance != self: - return self._logger.warning(f"This Reachy is in {mode} mode :{warning_str}.\n") def _check_inactivity_from_user(self, timeout: float = 60.0) -> None: