summaryrefslogtreecommitdiff
path: root/subplot/clab.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-04-17 14:06:10 +0300
committerLars Wirzenius <liw@liw.fi>2021-04-17 15:53:21 +0300
commitf236aef565c1f9c99dcf24979830b232ab6749bc (patch)
tree0d1053ad8ef0b6f7de9a74485b641b81dd85c0c4 /subplot/clab.py
parente325fc5e47e5ef34969a30fc6568a58a6026f39b (diff)
downloadclab-f236aef565c1f9c99dcf24979830b232ab6749bc.tar.gz
rewrite in rust
Diffstat (limited to 'subplot/clab.py')
-rw-r--r--subplot/clab.py17
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))