make output nicer
This commit is contained in:
parent
2f928b88dd
commit
c05a4ce79d
|
@ -117,7 +117,7 @@
|
||||||
;; Executes one rule
|
;; Executes one rule
|
||||||
(define (execute-rule r)
|
(define (execute-rule r)
|
||||||
(match-define (rule name ins out func) r)
|
(match-define (rule name ins out func) r)
|
||||||
(printf "executing: ~a\n" name)
|
(printf "executing: ~a -> ~a\n" name out)
|
||||||
(define cust (make-custodian))
|
(define cust (make-custodian))
|
||||||
(parameterize ([current-custodian cust])
|
(parameterize ([current-custodian cust])
|
||||||
(thread-wait
|
(thread-wait
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
"GMT")))
|
"GMT")))
|
||||||
|
|
||||||
(define (parse-url fetch-url)
|
(define (parse-url fetch-url)
|
||||||
(printf "fetching page: ~a\n" fetch-url)
|
(printf " fetching page: ~a\n" fetch-url)
|
||||||
(define parsed-url (if (string? fetch-url) (string->url fetch-url) fetch-url))
|
(define parsed-url (if (string? fetch-url) (string->url fetch-url) fetch-url))
|
||||||
(match parsed-url
|
(match parsed-url
|
||||||
[(url scheme user host port path-absolute? path query fragment)
|
[(url scheme user host port path-absolute? path query fragment)
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
[(? string?) (void)]
|
[(? string?) (void)]
|
||||||
[(list tag (list (list (? symbol?) (? string?)) ...) body ...)
|
[(list tag (list (list (? symbol?) (? string?)) ...) body ...)
|
||||||
(void (map check-detailed-xexpr body))]
|
(void (map check-detailed-xexpr body))]
|
||||||
[_ (displayln "problem:") (pretty-write x)]))
|
[_ (printf "problem:\n") (pretty-write x)]))
|
||||||
(unless (xexpr? x)
|
(unless (xexpr? x)
|
||||||
(check-detailed-xexpr x)
|
(check-detailed-xexpr x)
|
||||||
(error "not xexpr!"))
|
(error "not xexpr!"))
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
(define http-signature (format "keyId=\"~a\",algorithm=\"~a\",headers=\"~a\",signature=\"~a\""
|
(define http-signature (format "keyId=\"~a\",algorithm=\"~a\",headers=\"~a\",signature=\"~a\""
|
||||||
"foo://example-key" algorithm signed-header-spec signature))
|
"foo://example-key" algorithm signed-header-spec signature))
|
||||||
|
|
||||||
(displayln http-signature)
|
; (displayln http-signature)
|
||||||
|
|
||||||
;; GET /path HTTP/1.1
|
;; GET /path HTTP/1.1
|
||||||
(define req-headers
|
(define req-headers
|
||||||
|
@ -57,9 +57,9 @@
|
||||||
#:data #f
|
#:data #f
|
||||||
#:content-decode '(gzip deflate)))
|
#:content-decode '(gzip deflate)))
|
||||||
|
|
||||||
(displayln status)
|
; (displayln status)
|
||||||
(displayln resp-headers)
|
; (displayln resp-headers)
|
||||||
(displayln (port->bytes body))
|
; (displayln (port->bytes body))
|
||||||
|
|
||||||
(void "TODO")))
|
(void "TODO")))
|
||||||
|
|
||||||
|
|
2
util.rkt
2
util.rkt
|
@ -12,7 +12,7 @@
|
||||||
(~r num #:min-width pad-to #:pad-string "0"))
|
(~r num #:min-width pad-to #:pad-string "0"))
|
||||||
|
|
||||||
(define (run-external argv source)
|
(define (run-external argv source)
|
||||||
(printf "running external program: ~a\n" argv)
|
(printf " running external program: ~a\n" argv)
|
||||||
(define-values [proc out in err]
|
(define-values [proc out in err]
|
||||||
(apply subprocess #f #f #f "/usr/bin/env" argv))
|
(apply subprocess #f #f #f "/usr/bin/env" argv))
|
||||||
(define out-str #f)
|
(define out-str #f)
|
||||||
|
|
Loading…
Reference in New Issue