aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ravanan/slurm-api.scm2
-rw-r--r--ravanan/utils.scm10
-rw-r--r--ravanan/work/utils.scm10
3 files changed, 11 insertions, 11 deletions
diff --git a/ravanan/slurm-api.scm b/ravanan/slurm-api.scm
index 4ed02b5..fdc89fc 100644
--- a/ravanan/slurm-api.scm
+++ b/ravanan/slurm-api.scm
@@ -25,7 +25,7 @@
#:use-module (web client)
#:use-module (web uri)
#:use-module (json)
- #:use-module (ravanan utils)
+ #:use-module (ravanan work utils)
#:export (submit-job
job-state))
diff --git a/ravanan/utils.scm b/ravanan/utils.scm
index 5ae3c20..b2c3c94 100644
--- a/ravanan/utils.scm
+++ b/ravanan/utils.scm
@@ -21,7 +21,6 @@
#:use-module (srfi srfi-26)
#:use-module (ice-9 match)
#:export (string-trim-prefix
- json-ref
call-with-temporary-file))
(define (string-trim-prefix prefix str)
@@ -30,15 +29,6 @@
(substring str (string-length prefix))
str))
-(define (json-ref scm . keys)
- "Extract subtree of JSON @var{scm} that is addressed by @var{keys}."
- (match keys
- ((key other-keys ...)
- (apply json-ref
- ((if (list? scm) assoc-ref vector-ref) scm key)
- other-keys))
- (() scm)))
-
(define* (call-with-temporary-file proc #:optional (parent-directory (getcwd)))
"Call @var{proc} with an output port to a new temporary file in
@var{parent-directory}, and delete it when @var{proc} returns or exits
diff --git a/ravanan/work/utils.scm b/ravanan/work/utils.scm
index 1323352..15349b2 100644
--- a/ravanan/work/utils.scm
+++ b/ravanan/work/utils.scm
@@ -27,6 +27,7 @@
alist=?
assoc-ref*
assoc-set
+ json-ref
call-with-temporary-directory
call-with-input-pipe))
@@ -62,6 +63,15 @@ mutated."
tail))
(() alist)))
+(define (json-ref scm . keys)
+ "Extract subtree of JSON @var{scm} that is addressed by @var{keys}."
+ (match keys
+ ((key other-keys ...)
+ (apply json-ref
+ ((if (list? scm) assoc-ref vector-ref) scm key)
+ other-keys))
+ (() scm)))
+
(define* (call-with-temporary-directory proc
#:optional (parent-directory (getcwd)))
"Call @var{proc} with a new temporary directory in