2024-11-24 15:23:32 +01:00
|
|
|
(use-modules (ice-9 popen) (ice-9 textual-ports) (json parser))
|
|
|
|
|
|
|
|
(define (yml-file->scm filename)
|
|
|
|
(let* ((python_cmd (string-append "import sys, yaml, json; print(json.dumps(yaml.safe_load(open('" filename "'))))"))
|
2024-11-28 09:19:52 +01:00
|
|
|
(pipe (open-pipe* OPEN_READ "python3" "-c" python_cmd))
|
2024-11-24 15:23:32 +01:00
|
|
|
(json (get-string-all pipe)))
|
|
|
|
(close-pipe pipe)
|
|
|
|
(json-string->scm json)))
|
|
|
|
|
|
|
|
(define (parse-yml-file filename) (resolve-inherits (yml-file->scm filename)))
|