From 9b1049ed9f7af205c6e59d7f58b12dc04fd7d3fb Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Wed, 11 Sep 2024 15:38:35 +0100 Subject: ui: Move warning and error reporting functions to separate module. * ravanan/command-line-tool.scm: Import (ravanan ui). (warning, error): Move to (ravanan ui). * ravanan/ui.scm: New file. --- ravanan/command-line-tool.scm | 9 +-------- ravanan/ui.scm | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 ravanan/ui.scm diff --git a/ravanan/command-line-tool.scm b/ravanan/command-line-tool.scm index 9f77f2a..fcea77b 100644 --- a/ravanan/command-line-tool.scm +++ b/ravanan/command-line-tool.scm @@ -56,6 +56,7 @@ #:use-module (ravanan work command-line-tool) #:use-module (ravanan work types) #:use-module (ravanan work utils) + #:use-module (ravanan ui) #:export (run-command-line-tool command-line-tool-scheduler check-requirements @@ -90,14 +91,6 @@ (define %job-poll-interval 5) -(define (warning fmt . args) - (apply format (current-error-port) fmt args) - (newline)) - -(define (error fmt . args) - (apply warning fmt args) - (exit #f)) - (define-immutable-record-type (scheduler-proc name cwl scatter scatter-method) scheduler-proc? diff --git a/ravanan/ui.scm b/ravanan/ui.scm new file mode 100644 index 0000000..955134b --- /dev/null +++ b/ravanan/ui.scm @@ -0,0 +1,29 @@ +;;; ravanan --- High-reproducibility CWL runner powered by Guix +;;; Copyright © 2024 Arun Isaac +;;; +;;; This file is part of ravanan. +;;; +;;; ravanan is free software: you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation, either version 3 of the License, or +;;; (at your option) any later version. +;;; +;;; ravanan is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;;; General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with ravanan. If not, see . + +(define-module (ravanan ui) + #:export (warning + error)) + +(define (warning fmt . args) + (apply format (current-error-port) fmt args) + (newline)) + +(define (error fmt . args) + (apply warning fmt args) + (exit #f)) -- cgit v1.2.3