with-output-to-file -> call-with-output-file

pull/599/head
Christopher Lam 7 years ago
parent 977b1fcf9d
commit be4e452424

@ -53,11 +53,11 @@
(if test-title
(gnc:html-document-set-title! document test-title))
(let ((render (gnc:html-document-render document)))
(with-output-to-file (format #f "/tmp/~a-~a.html"
(call-with-output-file (format #f "/tmp/~a-~a.html"
(string-map sanitize-char prefix)
(string-map sanitize-char test-title))
(lambda ()
(display render)))
(lambda (p)
(display render p)))
render)))
(define (strip-string s1 s2)

@ -892,9 +892,9 @@ HTML Document Title</title></head><body></body>\n\
(gnc:html-document-set-style-sheet! doc (gnc:html-style-sheet-find "Default"))
(gnc:html-document-add-object! doc table)
(let ((render (gnc:html-document-render doc)))
(with-output-to-file (format #f "/tmp/html-acct-table-~a.html" prefix)
(lambda ()
(display render)))
(call-with-output-file (format #f "/tmp/html-acct-table-~a.html" prefix)
(lambda (p)
(display render p)))
(xml->sxml render
#:trim-whitespace? #t
#:entities '((nbsp . "\xa0")

@ -2204,9 +2204,9 @@ be excluded from periodic reporting.")
(if (list? csvlist)
(catch #t
(lambda ()
(with-output-to-file filename
(lambda ()
(display (lists->csv (append infolist csvlist))))))
(call-with-output-file filename
(lambda (p)
(display (lists->csv (append infolist csvlist)) p))))
(lambda (key . args)
;; Translators: ~a error type, ~a filename, ~s error details
(let ((fmt (N_ "error ~a during csv output to ~a: ~s")))

Loading…
Cancel
Save