diff --git a/rerun_py/rerun_sdk/rerun/__init__.py b/rerun_py/rerun_sdk/rerun/__init__.py index ad9045f04a35..e76af6231598 100644 --- a/rerun_py/rerun_sdk/rerun/__init__.py +++ b/rerun_py/rerun_sdk/rerun/__init__.py @@ -306,25 +306,14 @@ def serve(open_browser: bool = True) -> None: def disconnect() -> None: - """Disconnect from the remote rerun server (if any).""" - bindings.disconnect() - - -def show() -> None: """ - Show previously logged data. - - This only works if you have not called `connect`. - - NOTE: There is a bug which causes this function to only work once on some platforms. + Closes all TCP connections, servers, and files. + Closes all TCP connections, servers, and files that have been opened with + [`rerun.connect`], [`rerun.serve`], [`rerun.save`] or [`rerun.spawn`]. """ - if not bindings.is_enabled(): - print("Rerun is disabled - show() call ignored") - return - - bindings.show() + bindings.disconnect() def save(path: str) -> None: diff --git a/rerun_py/src/python_bridge.rs b/rerun_py/src/python_bridge.rs index eebf151c52f5..3f43246397d7 100644 --- a/rerun_py/src/python_bridge.rs +++ b/rerun_py/src/python_bridge.rs @@ -117,12 +117,7 @@ fn rerun_bindings(py: Python<'_>, m: &PyModule) -> PyResult<()> { m.add_function(wrap_pyfunction!(shutdown, m)?)?; m.add_function(wrap_pyfunction!(is_enabled, m)?)?; m.add_function(wrap_pyfunction!(set_enabled, m)?)?; - - #[cfg(feature = "native_viewer")] - { - m.add_function(wrap_pyfunction!(disconnect, m)?)?; - m.add_function(wrap_pyfunction!(show, m)?)?; - } + m.add_function(wrap_pyfunction!(disconnect, m)?)?; m.add_function(wrap_pyfunction!(save, m)?)?; m.add_function(wrap_pyfunction!(set_time_sequence, m)?)?; @@ -330,26 +325,11 @@ fn set_enabled(enabled: bool) { /// /// Subsequent log messages will be buffered and either sent on the next call to `connect`, /// or shown with `show`. -#[cfg(feature = "native_viewer")] #[pyfunction] fn disconnect() { global_session().disconnect(); } -/// Show the buffered log data. -/// -/// NOTE: currently this only works _once_. -/// Calling this function more than once is undefined behavior. -/// We will try to fix this in the future. -/// Blocked on . -#[cfg(feature = "native_viewer")] -#[pyfunction] -fn show() -> PyResult<()> { - global_session() - .show() - .map_err(|err| PyRuntimeError::new_err(format!("Failed to show Rerun Viewer: {err}"))) -} - #[pyfunction] fn save(path: &str) -> PyResult<()> { let mut session = global_session();