mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
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'.
This commit is contained in:
parent
4cdb27af48
commit
1fafa2f587
3 changed files with 76 additions and 55 deletions
|
@ -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))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue