diff options
Diffstat (limited to 'subplot/clab.py')
-rw-r--r-- | subplot/clab.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/subplot/clab.py b/subplot/clab.py new file mode 100644 index 0000000..94b2e51 --- /dev/null +++ b/subplot/clab.py @@ -0,0 +1,17 @@ +import io +import os +import yaml + + +def install_clab(ctx): + runcmd_prepend_to_path = globals()["runcmd_prepend_to_path"] + srcdir = globals()["srcdir"] + + # Add the directory with built Rust binaries to the path. + runcmd_prepend_to_path(ctx, dirname=os.path.join(srcdir, "target", "debug")) + + +def stdout_is_yaml(ctx): + runcmd_get_stdout = globals()["runcmd_get_stdout"] + stdout = runcmd_get_stdout(ctx) + yaml.safe_load(io.StringIO(stdout)) |