diff --git a/crates/re_data_source/src/data_loader/loader_external.rs b/crates/re_data_source/src/data_loader/loader_external.rs index f4a33231bd12..7c65eded9ac9 100644 --- a/crates/re_data_source/src/data_loader/loader_external.rs +++ b/crates/re_data_source/src/data_loader/loader_external.rs @@ -29,10 +29,21 @@ pub const EXTERNAL_DATA_LOADER_INCOMPATIBLE_EXIT_CODE: i32 = 66; pub static EXTERNAL_LOADER_PATHS: Lazy> = Lazy::new(|| { re_tracing::profile_function!(); + let dir_separator = if cfg!(target_os = "windows") { + ';' + } else { + ':' + }; + let dirpaths = std::env::var("PATH") .ok() .into_iter() - .flat_map(|paths| paths.split(':').map(ToOwned::to_owned).collect::>()) + .flat_map(|paths| { + paths + .split(dir_separator) + .map(ToOwned::to_owned) + .collect::>() + }) .map(std::path::PathBuf::from); let mut executables = HashMap::>::default(); diff --git a/docs/cspell.json b/docs/cspell.json index fd104e22d074..ab8f62f67141 100644 --- a/docs/cspell.json +++ b/docs/cspell.json @@ -280,6 +280,7 @@ "obj", "odometry", "omahs", + "onefile", "pablovela", "pacman", "parametrizations", @@ -293,6 +294,7 @@ "proto", "protoc", "pycollada", + "pyinstaller", "pyopf", "pypi", "pyright", diff --git a/examples/python/external_data_loader/README.md b/examples/python/external_data_loader/README.md index 3452a3a40b2c..3eae87fcba0d 100644 --- a/examples/python/external_data_loader/README.md +++ b/examples/python/external_data_loader/README.md @@ -18,4 +18,9 @@ thumbnail_dimensions: [480, 302] This is an example executable data-loader plugin for the Rerun Viewer. It will log Python source code files as markdown documents. -To try it out, copy it in your $PATH as `rerun-loader-python-file`, then open a Python source file with Rerun (`rerun file.py`). + +On Linux & Mac you can simply copy it in your $PATH as `rerun-loader-python-file.py`, then open a Python source file with Rerun (`rerun file.py`). +Make sure the file has a shebang (`#!/usr/bin/env python3`) and is executable (`chmod +x`). + +On Windows you have to install the script as an executable first and then put the executable under %PATH%. +One way to do this is to use `pyinstaller`: `pyinstaller .\examples\python\external_data_loader\main.py -n rerun-loader-python-file --onefile`