Display progress bars.
This commit is contained in:
parent
ca1270d7ae
commit
99fac43aa4
1 changed files with 10 additions and 2 deletions
12
progress.scm
12
progress.scm
|
@ -116,9 +116,17 @@
|
|||
(* raw-value
|
||||
(- (cdr range) (car range)))))
|
||||
(value% (* 100 value))
|
||||
(ivalue% (inexact->exact (round value%))))
|
||||
(ivalue% (inexact->exact (round value%)))
|
||||
(bwidth (inexact->exact
|
||||
(round
|
||||
(* value (*progress%-width*)))))
|
||||
(swidth (- (*progress%-width*) bwidth)))
|
||||
(display
|
||||
(sprintf "\r[]~A% ~A" ivalue% (*current-progress%*))))))
|
||||
(sprintf "\r[~A~A]~A% ~A"
|
||||
(make-string bwidth #\=)
|
||||
(make-string swidth #\space)
|
||||
ivalue%
|
||||
(*current-progress%*))))))
|
||||
|
||||
;; If the new value is different-enough from the current one, updates
|
||||
;; it and re-prints the progress%
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue