Skip to content

Commit ae433dd

Browse files
committed
Check for PROCESSING_ASSET_ROOT when running python
1 parent a27312f commit ae433dd

File tree

1 file changed

+6
-0
lines changed
  • crates/processing_pyo3/src

1 file changed

+6
-0
lines changed

crates/processing_pyo3/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ mod graphics;
1414
use graphics::{Graphics, get_graphics, get_graphics_mut};
1515
use pyo3::{exceptions::PyRuntimeError, prelude::*};
1616

17+
use std::env;
18+
1719
#[pymodule]
1820
fn processing(m: &Bound<'_, PyModule>) -> PyResult<()> {
1921
m.add_class::<Graphics>()?;
@@ -31,6 +33,10 @@ fn processing(m: &Bound<'_, PyModule>) -> PyResult<()> {
3133
}
3234

3335
fn get_asset_root() -> PyResult<String> {
36+
if let Ok(val) = env::var("PROCESSING_ASSET_ROOT") {
37+
return Ok(val);
38+
}
39+
3440
Python::attach(|py| {
3541
let sys = PyModule::import(py, "sys")?;
3642
let argv: Vec<String> = sys.getattr("argv")?.extract()?;

0 commit comments

Comments
 (0)