diff options
author | Ludovic Courtès <ludo@gnu.org> | 2017-11-22 14:39:26 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2017-12-01 16:00:14 +0100 |
commit | 1fafa2f58732a3fb75258be342c92a2772af2860 (patch) | |
tree | 6018c4d2844b2a638176e7d66c9cda33010679bf /guix/progress.scm | |
parent | 4cdb27af48c83b7d036c4d8cccb792a51d766790 (diff) | |
download | gnu-guix-1fafa2f58732a3fb75258be342c92a2772af2860.tar gnu-guix-1fafa2f58732a3fb75258be342c92a2772af2860.tar.gz |
weather: Use (guix progress) for progress report.
* guix/progress.scm (start-progress-reporter!, stop-progress-reporter!)
(progress-reporter-report!): New procedures.
* guix/scripts/weather.scm (call-with-progress-reporter): New procedure.
(package-outputs)[update-progress!]: Remove.
Use 'call-with-progress-reporter' instead.
(guix-weather): Parameterize 'current-terminal-columns'.
Diffstat (limited to 'guix/progress.scm')
-rw-r--r-- | guix/progress.scm | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/guix/progress.scm b/guix/progress.scm index 1ee7ec319f..0ca5c08782 100644 --- a/guix/progress.scm +++ b/guix/progress.scm @@ -31,6 +31,10 @@ progress-reporter? call-with-progress-reporter + start-progress-reporter! + stop-progress-reporter! + progress-reporter-report! + progress-reporter/silent progress-reporter/file progress-reporter/bar @@ -60,6 +64,24 @@ stopped." (($ <progress-reporter> start report stop) (dynamic-wind start (lambda () (proc report)) stop)))) +(define (start-progress-reporter! reporter) + "Low-level procedure to start REPORTER." + (match reporter + (($ <progress-reporter> start report stop) + (start)))) + +(define (progress-reporter-report! reporter) + "Low-level procedure to lead REPORTER to emit a report." + (match reporter + (($ <progress-reporter> start report stop) + (report)))) + +(define (stop-progress-reporter! reporter) + "Low-level procedure to stop REPORTER." + (match reporter + (($ <progress-reporter> start report stop) + (stop)))) + (define progress-reporter/silent (make-progress-reporter noop noop noop)) |