pyridis_examples/
lib.rs

1pub mod prelude {
2    pub use thirdparty::*;
3
4    pub mod thirdparty {
5        pub use iridis::prelude as ird;
6    }
7}
8
9use std::path::PathBuf;
10
11use iridis::prelude::thirdparty::*;
12
13pub fn dylib(name: &str, build: Option<&str>) -> Result<PathBuf> {
14    let path = std::env::var("CARGO_MANIFEST_DIR")?;
15    let path = format!("{}/../../target/{}", path, build.unwrap_or("debug"));
16
17    let prefix = std::env::consts::DLL_PREFIX;
18    let dylib = std::env::consts::DLL_SUFFIX;
19
20    Ok(PathBuf::from(&format!(
21        "{}/{}{}{}",
22        path, prefix, name, dylib
23    )))
24}
25
26pub fn pyfile(name: &str) -> Result<Url> {
27    let path = std::env::var("CARGO_MANIFEST_DIR")?;
28    let path = format!("file://{}/examples", path);
29
30    Url::parse(&format!("{}/{}", path, name)).map_err(eyre::Report::msg)
31}