diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-04-17 14:06:10 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-04-17 15:53:21 +0300 |
commit | f236aef565c1f9c99dcf24979830b232ab6749bc (patch) | |
tree | 0d1053ad8ef0b6f7de9a74485b641b81dd85c0c4 /subplot/clab.py | |
parent | e325fc5e47e5ef34969a30fc6568a58a6026f39b (diff) | |
download | clab-f236aef565c1f9c99dcf24979830b232ab6749bc.tar.gz |
rewrite in rust
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)) |